Search Results

Search found 1485 results on 60 pages for 'dan heyse'.

Page 34/60 | < Previous Page | 30 31 32 33 34 35 36 37 38 39 40 41  | Next Page >

  • Suppressing PostSharp Multicast with Attribute

    - by Dan Bryant
    I've recently started experimenting with PostSharp and I found a particularly helpful aspect to automate implementation of INotifyPropertyChanged. You can see the example here. The basic functionality is excellent (all properties will be notified), but there are cases where I might want to suppress notification. For instance, I might know that a particular property is set once in the constructor and will never change again. As such, there is no need to emit the code for NotifyPropertyChanged. The overhead is minimal when classes are not frequently instantiated and I can prevent the problem by switching from an automatically generated property to a field-backed property and writing to the field. However, as I'm learning this new tool, it would be helpful to know if there is a way to tag a property with an attribute to suppress the code generation. I'd like to be able to do something like this: [NotifyPropertyChanged] public class MyClass { public double SomeValue { get; set; } public double ModifiedValue { get; private set; } [SuppressNotify] public double OnlySetOnce { get; private set; } public MyClass() { OnlySetOnce = 1.0; } }

    Read the article

  • How would I create a silverlight control for tagging content similar to StackOverflow?

    - by Dan Ryan
    I am new to Silverlight. How would I go about creating a control for users to tag content. I would like it to work like it does it StackOverflow i.e. Autocomplete and when you press space it inserts the tag in a box with a remove button. I want the control to be bindable to a collection of strings. If someone can just point me in the right direction to get me started I would be very grateful.

    Read the article

  • Unlocking a mutex from a different thread (C++)

    - by dan
    I'm using the C++ boost::thread library, which in my case means I'm using pthreads. Officially, a mutex must be unlocked from the same thread which locks it, and I want the effect of being able to lock in one thread and then unlock in another. There are many ways to accomplish this. One possibility would be to write a new mutex class which allows this behavior. For example: class inter_thread_mutex{ bool locked; boost::mutex mx; boost::condition_variable cv; public: void lock(){ boost::unique_lock<boost::mutex> lck(mx); while(locked) cv.wait(lck); locked=true; } void unlock(){ { boost::lock_guard<boost::mutex> lck(mx); if(!locked) error(); locked=false; } cv.notify_one(); } // bool try_lock(); void error(); etc. } I should point out that the above code doesn't guarantee FIFO access, since if one thread calls lock() while another calls unlock(), this first thread may acquire the lock ahead of other threads which are waiting. (Come to think of it, the boost::thread documentation doesn't appear to make any explicit scheduling guarantees for either mutexes or condition variables). But let's just ignore that (and any other bugs) for now. My question is, if I decide to go this route, would I be able to use such a mutex as a model for the boost Lockable concept. For example, would anything go wrong if I use a boost::unique_lock< inter_thread_mutex for RAII-style access, and then pass this lock to boost::condition_variable_any.wait(), etc. On one hand I don't see why not. On the other hand, "I don't see why not" is usually a very bad way of determining whether something will work. The reason I ask is that if it turns out that I have to write wrapper classes for RAII locks and condition variables and whatever else, then I'd rather just find some other way to achieve the same effect.

    Read the article

  • Maze not generating properly. Out of bounds exception. need quick fix

    - by Dan Joseph Porcioncula
    My maze generator seems to have a problem. I am trying to generate something like the maze from http://mazeworks.com/mazegen/mazetut/index.htm . My program displays this http://a1.sphotos.ak.fbcdn.net/hphotos-ak-snc7/s320x320/374060_426350204045347_100000111130260_1880768_1572427285_n.jpg and the error Exception in thread "main" java.lang.ArrayIndexOutOfBoundsException: -1 at Grid.genRand(Grid.java:73) at Grid.main(Grid.java:35) How do I fix my generator program? import java.awt.*; import java.awt.Color; import java.awt.Component; import java.awt.Graphics; import javax.swing.*; import java.util.ArrayList; public class Grid extends Canvas { Cell[][] maze; int size; int pathSize; double width, height; ArrayList<int[]> coordinates = new ArrayList<int[]>(); public Grid(int size, int h, int w) { this.size = size; maze = new Cell[size][size]; for(int i = 0; i<size; i++){ for(int a =0; a<size; a++){ maze[i][a] = new Cell(); } } setPreferredSize(new Dimension(h, w)); } public static void main(String[] args) { JFrame y = new JFrame(); y.setLayout(new BorderLayout()); Grid f = new Grid(25, 400, 400); y.add(f, BorderLayout.CENTER); y.setSize(450, 450); y.setVisible(true); y.setDefaultCloseOperation(y.EXIT_ON_CLOSE); f.genRand(); f.repaint(); } public void push(int[] xy) { coordinates.add(xy); int i = coordinates.size(); coordinates.ensureCapacity(i++); } public int[] pop() { int[] x = coordinates.get((coordinates.size())-1); coordinates.remove((coordinates.size())-1); return x; } public int[] top() { return coordinates.get((coordinates.size())-1); } public void genRand(){ // create a CellStack (LIFO) to hold a list of cell locations [x] // set TotalCells = number of cells in grid int TotalCells = size*size; // choose a cell at random and call it CurrentCell int m = randomInt(size); int n = randomInt(size); Cell curCel = maze[m][n]; // set VisitedCells = 1 int visCel = 1,d=0; int[] q; int h,o = 0,p = 0; // while VisitedCells < TotalCells while( visCel < TotalCells){ // find all neighbors of CurrentCell with all walls intact if(maze[m-1][n].countWalls() == 4){d++;} if(maze[m+1][n].countWalls() == 4){d++;} if(maze[m][n-1].countWalls() == 4){d++;} if(maze[m][n+1].countWalls() == 4){d++;} // if one or more found if(d!=0){ Point[] ls = new Point[4]; ls[0] = new Point(m-1,n); ls[1] = new Point(m+1,n); ls[2] = new Point(m,n-1); ls[3] = new Point(m,n+1); // knock down the wall between it and CurrentCell h = randomInt(3); switch(h){ case 0: o = (int)(ls[0].getX()); p = (int)(ls[0].getY()); curCel.destroyWall(2); maze[o][p].destroyWall(1); break; case 1: o = (int)(ls[1].getX()); p = (int)(ls[1].getY()); curCel.destroyWall(1); maze[o][p].destroyWall(2); break; case 2: o = (int)(ls[2].getX()); p = (int)(ls[2].getY()); curCel.destroyWall(3); maze[o][p].destroyWall(0); break; case 3: o = (int)(ls[3].getX()); p = (int)(ls[3].getY()); curCel.destroyWall(0); maze[o][p].destroyWall(3); break; } // push CurrentCell location on the CellStack push(new int[] {m,n}); // make the new cell CurrentCell m = o; n = p; curCel = maze[m][n]; // add 1 to VisitedCells visCel++; } // else else{ // pop the most recent cell entry off the CellStack q = pop(); m = q[0]; n = q[1]; curCel = maze[m][n]; // make it CurrentCell // endIf } // endWhile } } public int randomInt(int s) { return (int)(s* Math.random());} public void paint(Graphics g) { int k, j; width = getSize().width; height = getSize().height; double htOfRow = height / (size); double wdOfRow = width / (size); //checks verticals - destroys east border of cell for (k = 0; k < size; k++) { for (j = 0; j < size; j++) { if(maze[k][j].checkWall(2)){ g.drawLine((int) (k * wdOfRow), (int) (j * htOfRow), (int) (k * wdOfRow), (int) ((j+1) * htOfRow)); }} } //checks horizontal - destroys north border of cell for (k = 0; k < size; k++) { for (j = 0; j < size; j++) { if(maze[k][j].checkWall(3)){ g.drawLine((int) (k * wdOfRow), (int) (j * htOfRow), (int) ((k+1) * wdOfRow), (int) (j * htOfRow)); }} } } } class Cell { private final static int NORTH = 0; private final static int EAST = 1; private final static int WEST = 2; private final static int SOUTH = 3; private final static int NO = 4; private final static int START = 1; private final static int END = 2; boolean[] wall = new boolean[4]; boolean[] border = new boolean[4]; boolean[] backtrack = new boolean[4]; boolean[] solution = new boolean[4]; private boolean isVisited = false; private int Key = 0; public Cell(){ for(int i=0;i<4;i++){wall[i] = true;} } public int countWalls(){ int i, k =0; for(i=0; i<4; i++) { if (wall[i] == true) {k++;} } return k;} public boolean checkWall(int x){ switch(x){ case 0: return wall[0]; case 1: return wall[1]; case 2: return wall[2]; case 3: return wall[3]; } return true; } public void destroyWall(int x){ switch(x){ case 0: wall[0] = false; break; case 1: wall[1] = false; break; case 2: wall[2] = false; break; case 3: wall[3] = false; break; } } public void setStart(int i){Key = i;} public int getKey(){return Key;} public boolean checkVisit(){return isVisited;} public void visitCell(){isVisited = true;} }

    Read the article

  • Java3d resetting to a new scene

    - by Dan Howard
    Hi all, I'm working on a game in Java3D. I read all my level info from a file and it works fine. But now I want to re-initialize the scene from reading data from a different file. How do I reset the scene? Should I just destroy the whole canvas3D and universe objects?

    Read the article

  • ListView in ArrayAdapter order get's mixed up when scrolling

    - by Dan B
    Hi, I have a ListView in a custom ArrayAdapter that displays an icon ImageView and a TextView in each row. When I make the list long enough to let you scroll through it, the order starts out right, but when I start to scroll down, some of the earlier entries start re-appearing. If I scroll back up, the old order changes. Doing this repeatedly eventually causes the entire list order to be seemingly random. So scrolling the list is either causing the child order to change, or the drawing is not refreshing correctly. What could cause something like this to happen? I need the order the items are displayed to the user to be the same order they are added to the ArrayList, or at LEAST to remain in one static order. If I need to provide more detailed information, please let me know. Any help is appreciated. Thanks.

    Read the article

  • Convert Decimal to ASCII

    - by Dan Snyder
    I'm having difficulty using reinterpret_cast. Before I show you my code I'll let you know what I'm trying to do. I'm trying to get a filename from a vector full of data being used by a MIPS I processor I designed. Basically what I do is compile a binary from a test program for my processor, dump all the hex's from the binary into a vector in my c++ program, convert all of those hex's to decimal integers and store them in a DataMemory vector which is the data memory unit for my processor. I also have instruction memory. So When my processor runs a SYSCALL instruction such as "Open File" my C++ operating system emulator receives a pointer to the beginning of the filename in my data memory. So keep in mind that data memory is full of ints, strings, globals, locals, all sorts of stuff. When I'm told where the filename starts I do the following: Convert the whole decimal integer element that is being pointed to to its ASCII character representation, and then search from left to right to see if the string terminates, if not then just load each character consecutively into a "filename" string. Do this until termination of the string in memory and then store filename in a table. My difficulty is generating filename from my memory. Here is an example of what I'm trying to do: C++ Syntax (Toggle Plain Text) 1.Index Vector NewVector ASCII filename 2.0 240faef0 128123792 'abc7' 'a' 3.0 240faef0 128123792 'abc7' 'ab' 4.0 240faef0 128123792 'abc7' 'abc' 5.0 240faef0 128123792 'abc7' 'abc7' 6.1 1234567a 243225 'k2s0' 'abc7k' 7.1 1234567a 243225 'k2s0' 'abc7k2' 8.1 1234567a 243225 'k2s0' 'abc7k2s' 9. //EXIT LOOP// 10.1 1234567a 243225 'k2s0' 'abc7k2s' Index Vector NewVector ASCII filename 0 240faef0 128123792 'abc7' 'a' 0 240faef0 128123792 'abc7' 'ab' 0 240faef0 128123792 'abc7' 'abc' 0 240faef0 128123792 'abc7' 'abc7' 1 1234567a 243225 'k2s0' 'abc7k' 1 1234567a 243225 'k2s0' 'abc7k2' 1 1234567a 243225 'k2s0' 'abc7k2s' //EXIT LOOP// 1 1234567a 243225 'k2s0' 'abc7k2s' Here is the code that I've written so far to get filename (I'm just applying this to element 1000 of my DataMemory vector to test functionality. 1000 is arbitrary.): C++ Syntax (Toggle Plain Text) 1.int i = 0; 2.int step = 1000;//top->a0; 3.string filename; 4.char *temp = reinterpret_cast<char*>( DataMemory[1000] );//convert to char 5.cout << "a0:" << top->a0 << endl;//pointer supplied 6.cout << "Data:" << DataMemory[top->a0] << endl;//my vector at pointed to location 7.cout << "Data(1000):" << DataMemory[1000] << endl;//the element I'm testing 8.cout << "Characters:" << &temp << endl;//my temporary char array 9. 10.while(&temp[i]!=0) 11.{ 12. filename+=temp[i];//add most recent non-terminated character to string 13. i++; 14. if(i==4)//when 4 chatacters have been added.. 15. { 16. i=0; 17. step+=1;//restart loop at the next element in DataMemory 18. temp = reinterpret_cast<char*>( DataMemory[step] ); 19. } 20. } 21. cout << "Filename:" << filename << endl; int i = 0; int step = 1000;//top-a0; string filename; char *temp = reinterpret_cast( DataMemory[1000] );//convert to char cout << "a0:" << top-a0 << endl;//pointer supplied cout << "Data:" << DataMemory[top-a0] << endl;//my vector at pointed to location cout << "Data(1000):" << DataMemory[1000] << endl;//the element I'm testing cout << "Characters:" << &temp << endl;//my temporary char array while(&temp[i]!=0) { filename+=temp[i];//add most recent non-terminated character to string i++; if(i==3)//when 4 chatacters have been added.. { i=0; step+=1;//restart loop at the next element in DataMemory temp = reinterpret_cast( DataMemory[step] ); } } cout << "Filename:" << filename << endl; So the issue is that when I do the conversion of my decimal element to a char array I assume that 8 hex #'s will give me 4 characters. Why isn't this this case? Here is my output: C++ Syntax (Toggle Plain Text) 1.a0:0 2.Data:0 3.Data(1000):4428576 4.Characters:0x7fff5fbff128 5.Segmentation fault

    Read the article

  • JSON VIEW using GROUP_CONCAT question

    - by Dan Beam
    Hey DBAs and overall smart dudes. I have a question for you. We use MySQL VIEWs to format our data as JSON when it's returned (as a BLOB), which is convenient (though not particularly nice on performance, but we already know this). But, I can't seem to get a particular query working right now (each row contains NULL when it should contain a created JSON object with the values of multiple JOINs). Here's the general idea: SELECT CONCAT( "{", "\"some_list\":[", GROUP_CONCAT( DISTINCT t1.id ), "],", "\"other_list\":[", GROUP_CONCAT( DISTINCT t2.id ), "],", "}" ) cool_json FROM table_name tn INNER JOIN ( some_table st ) ON st.some_id = tn.id LEFT JOIN ( another_table at, another_one ao, used_multiple_times t1 ) ON st.id = at.some_id AND at.different_id = ao.different_id AND ao.different_id = t1.id LEFT JOIN ( another_table2 at2, another_one2 ao2, used_multiple_times t2 ) ON st.id = at2.some_id AND at2.different_id = ao2.different_id AND ao2.different_id = t2.id GROUP BY tn.id ORDER BY tn.name Anybody know the problem here? Am I missing something I should be grouping by? It was working when I was only doing 1 LEFT JOIN & GROUP_CONCAT, but now with multiple JOINs / GROUP_CONCATs it's messing it up. When I move the GROUP_CONCATs from the "cool_json" field they work as expected, but I'd like my data formatted as JSON so I can decode it server-side or client-side in one step.

    Read the article

  • How to apply coding methodologies and practices to non-coding work?

    - by Dan
    I can talk for hours about best-practice, source control, change management, feature tracking, development cycles and the lot, but most of what I've learnt or read seems to apply to nuts-and-bolts programming of compiled applications. You know, ASCII files that gets turned into 1s and 0s. How does one apply the same discipline and wisdom to working in environments that are point-and-click, config-centric. I'm thinking of CMSs and specifically, my current 9 to 5, SharePoint. Traditional practices of source control, dev-staging-production seem to break down since we're not working with code, and the live environment changes with user input. So to sum up a rather lengthy question, what works in a no-code environment?

    Read the article

  • How can I prevent SerializeJSON from changing Yes/No/True/False strings to boolean?

    - by Dan Roberts
    I have a data struct being stored in JSON format, converted using the serializeJSON function. The problem I am running into is that strings that can be boolean in CF such as Yes,No,True,and False are converted into JSON as boolean values. Below is example code. Any ideas on how to prevent this? Code: <cfset test = {str='Yes'}> <cfset json = serializeJSON(test)> <cfset fromJSON = deserializeJSON(json)> <cfoutput> #test.str#<br> #json#<br> #fromJSON.str# </cfoutput> Result: Yes {"STR":true} YES

    Read the article

  • Refactor/rewrite code or continue?

    - by Dan
    I just completed a complex piece of code. It works to spec, it meets performance requirements etc etc but I feel a bit anxious about it and am considering rewriting and/or refactoring it. Should I do this (spending time that could otherwise be spent on features that users will actually notice)? The reasons I feel anxious about the code are: The class hierarchy is complex and not obvious Some classes don't have a well defined purpose (they do a number of unrelated things) Some classes use others internals (they're declared as friend classes) to bypass the layers of abstraction for performance, but I feel they break encapsulation by doing this Some classes leak implementation details (eg, I changed a map to a hash map earlier and found myself having to modify code in other source files to make the change work) My memory management/pooling system is kinda clunky and less-than transparent They look like excellent reasons to refactor and clean code, aiding future maintenance and extension, but could be quite time consuming. Also, I'll never be perfectly happy with any code I write anyway... So, what does stackoverflow think? Clean code or work on features?

    Read the article

  • java progress bar while applet loads

    - by Dan
    OK so, let's say I have a Java applet that takes a while to load (~5 secs). It's getting the mysql-connector.jar and it's loading. Well.. instead of the gray box with the coffee logo... can I make it have a simple progress bar with the percent? Thanks.

    Read the article

  • c# Regex on XML string handler

    - by Dan Sewell
    Hi guys. Trying to fiddle around with regex here, my first attempt. Im trying to extract some figures out of content from an XML tag. The content looks like this: www.blahblah.se/maps.aspx?isAlert=true&lat=51.958855252721&lon=-0.517657021473527 I need to extract the lat and long numerical vales out of each link. They will always be the same amount of characters, and the lon may or may not have a "-" sign. I thought about doing something like this below: (The string in question is in the "link" tag): var document = XDocument.Load(e.Result); if (document.Root == null) return; var events = from ev in document.Descendants("item1") select new { Title = (ev.Element("title").Value), Latitude = Regex.xxxxxxx(ev.Element("link").Value, @"lat=(?<Lat>[+-]?\d*\.\d*)", String.Empty), Longitude = Convert.ToDouble(ev.Element("link").Value), }; foreach (var ev in events) { do stuff } Many thanks!

    Read the article

  • Writing to a java socket channel which should be closed does not generate an exception

    - by Dan Serfaty
    Hi all, We have a java server that keeps a socket channel open with an Android client in order to provide push capabilities to our client application. However, after putting the Android in airplane mode, which I expected would sever the connection, the server can still write to the SocketChannel object associated with that Android client and no error is thrown. Calling SocketChannel.isConnected() before writing to it returns true. What are we missing? Is the handling of sockets different with mobile devices? Thanks in advance for your help.

    Read the article

  • How do I ensure only the headers are shown for the first item in an ItemsControl in WPF?

    - by Dan Ryan
    I am using MVVM binding an ObservableCollection of children to an ItemsControl. The ItemsControl contains a UserControl used to style the UI for the children. <ItemsControl ItemsSource="{Binding Documents}"> <ItemsControl.ItemTemplate> <DataTemplate> <View:DocumentView Margin="0, 10, 0, 0" /> </DataTemplate> </ItemsControl.ItemTemplate> </ItemsControl> I want to show a header row for the contents of the ItemsControl but only want to show this once at the top (not for every child). How can I implement this behaviour in the DocumentView user control? Fyi I am using a Grid layout to style the child rows: <Grid> <Grid.ColumnDefinitions> <ColumnDefinition Width="34"/> <ColumnDefinition Width="100"/> <ColumnDefinition Width="*" /> <ColumnDefinition Width="60" /> </Grid.ColumnDefinitions> <Grid.RowDefinitions> <RowDefinition /> <RowDefinition /> </Grid.RowDefinitions> <TextBlock Grid.ColumnSpan="4" Grid.Row="0" Text="Should only show this at the top"></TextBlock> <Image Grid.Column="0" Grid.Row="1" Height="24" Width="24" Source="/Beazley.Documents.Presentation;component/Icons/error.png"></Image> <ComboBox Grid.Column="1" Grid.Row="1" Name="ContentTypes" ItemsSource="{Binding RelativeSource={RelativeSource FindAncestor, AncestorType={x:Type View:MainView}}, Path=DataContext.ContentTypes}" SelectedValue="{Binding ContentType}"/> <TextBox Grid.Column="2" Grid.Row="1" Text="{Binding Path=FileName}"/> <Button Grid.Column="3" Grid.Row="1" Command="{Binding RelativeSource={RelativeSource FindAncestor, AncestorType={x:Type View:MainView}}, Path=DataContext.RemoveFile}" CommandParameter="{Binding}">Remove</Button> </Grid>

    Read the article

  • Using OUTPUT/INTO within instead of insert trigger invalidates 'inserted' table

    - by Dan
    I have a problem using a table with an instead of insert trigger. The table I created contains an identity column. I need to use an instead of insert trigger on this table. I also need to see the value of the newly inserted identity from within my trigger which requires the use of OUTPUT/INTO within the trigger. The problem is then that clients that perform INSERTs cannot see the inserted values. For example, I create a simple table: CREATE TABLE [MyTable]( [MyID] [int] IDENTITY(1,1) NOT NULL, [MyBit] [bit] NOT NULL, CONSTRAINT [PK_MyTable_MyID] PRIMARY KEY NONCLUSTERED ( [MyID] ASC )) Next I create a simple instead of trigger: create trigger [trMyTableInsert] on [MyTable] instead of insert as BEGIN DECLARE @InsertedRows table( MyID int, MyBit bit); INSERT INTO [MyTable] ([MyBit]) OUTPUT inserted.MyID, inserted.MyBit INTO @InsertedRows SELECT inserted.MyBit FROM inserted; -- LOGIC NOT SHOWN HERE THAT USES @InsertedRows END; Lastly, I attempt to perform an insert and retrieve the inserted values: DECLARE @tbl TABLE (myID INT) insert into MyTable (MyBit) OUTPUT inserted.MyID INTO @tbl VALUES (1) SELECT * from @tbl The issue is all I ever get back is zero. I can see the row was correctly inserted into the table. I also know that if I remove the OUTPUT/INTO from within the trigger this problem goes away. Any thoughts as to what I'm doing wrong? Or is how I want to do things not feasible? Thanks.

    Read the article

  • How would you code a washing machine?

    - by Dan
    Imagine I have a class that represents a simple washing machine. It can perform following operations in the following order: turn on - wash - centrifuge - turn off. I see two basic alternatives: A) I can have a class WashingMachine with methods turnOn(), wash(int minutes), centrifuge(int revs), turnOff(). The problem with this is that the interface says nothing about the correct order of operations. I can at best throw InvalidOprationException if the client tries to centrifuge before machine was turned on. B) I can let the class itself take care of correct transitions and have the single method nextOperation(). The problem with this on the other hand, is that the semantics is poor. Client will not know what will happen when he calls the nextOperation(). Imagine you implement the centrifuge button’s click event so it calls nextOperation(). User presses the centrifuge button after machine was turned on and ups! machine starts to wash. I will probably need a few properties on my class to parameterize operations, or maybe a separate Program class with washLength and centrifugeRevs fields, but that is not really the problem. Which alternative is better? Or maybe there are some other, better alternatives that I missed to describe?

    Read the article

  • ASP.NET GridView - Cannot set the colour of the row during databind?

    - by Dan
    This is driving me NUTS! It's something that I've done 100s of time with a Datagrid. I'm now using a Gridview and I can't figure this out. I've got this grid: <asp:GridView AutoGenerateColumns="false" runat="server" ID="gvSelect" CssClass="GridViewStyle" GridLines="None" ShowHeader="False" PageSize="20" AllowPaging="True"> <Columns> <asp:TemplateField> <ItemTemplate> <asp:Label runat="server" ID="lbldas" Text="blahblah"></asp:Label> </ItemTemplate> </asp:TemplateField> </Columns> And during the RowDataBound I've tried: Protected Sub gvSelect_RowDataBound(ByVal sender As Object, ByVal e As System.Web.UI.WebControls.GridViewRowEventArgs) Handles gvSelect.RowCreated If e.Row.RowType = DataControlRowType.DataRow Then e.Row.Attributes.Add("onMouseOver", "this.style.backgroundColor='lightgrey'") End If End Sub And it NEVER sets the row backcolor.. I've been successful in using: gridrow.Cells(0).BackColor = Drawing.Color.Blue But doing the entire row? NOPE! and it's driving me nuts.. does ANYONE have solution for me? And just for fun I put this on the SAME page: <asp:DataGrid AutoGenerateColumns="false" runat="server" ID="dgSelect" GridLines="None" ShowHeader="False" PageSize="20" AllowPaging="True"> <Columns> <asp:TemplateColumn> <ItemTemplate> <asp:Label runat="server" ID="lbldas" Text="blahblah"></asp:Label> </ItemTemplate> </asp:TemplateColumn> </Columns> </asp:DataGrid> And in the ItemDataBound I put: If Not e.Item.ItemType = ListItemType.Header And Not e.Item.ItemType = ListItemType.Footer Then e.Item.Attributes.Add("onMouseOver", "this.style.backgroundColor='lightgrey'") End If And it works as expected.. SO What am I doing wrong with the Gridview? UPDATE ************** I thought I'd post the resulting HTML to show that any styles aren't affecting this. Here's the gridview html: <div class="AspNet-GridView" id="gvSelect"> <table cellpadding="0" cellspacing="0" summary=""> <tbody> <tr> <td> <span id="gvSelect_ctl02_lbldas">blahblah</span> </td> </tr> </tbody> </table> </div> And here's the resulting Datagrid HTML: <table cellspacing="0" border="0" id="dgSelect" style="border-collapse:collapse;"> <tr onMouseOver="this.style.backgroundColor='lightgrey'"> <td> <span id="dgSelect_ctl03_lbldas">blahblah</span> </td> </tr> </table> See.. the main difference is the tag. It never gets set in the gridview.. and I don't know why.. I've traced through it.. and the code gets run.. :S

    Read the article

  • SQL2008 merge replication fails to update depdendent items when table is added

    - by Dan Puzey
    Setup: an existing SQL2008 merge replication scenario. A large server database, including views and stored procs, being replicated to client machines. What I'm doing: * adding a new table to the database * mark the new table for replication (using SP_AddMergeArticle) * alter a view (which is already part of the replicated content) is updated to include fields from this new table (which is joined to the tables in the existing view). A stored procedure is similarly updated. The problem: the table gets replicated to client machines, but the view is not updated. The stored procedure is also not updated. Non-useful workaround: if I run the snapshot agent after calling SP_AddMergeArticle and before updating the view/SP, both the view and the stored procedure changes correctly replicate to the client. The bigger problem: I'm running a list of database scripts in a transaction, as part of a larger process. The snapshot agent can't be run during a transaction, and if I interrupt the transaction (e.g. by running the scripts in multiple transactions), I lose the ability to roll back the changes should something fail. Does anyone have any suggestions? It seems like I must be missing something obvious, because I don't see why the changes to the view/sproc wouldn't be replicating anyway, regardless of what's going on with the new table.

    Read the article

< Previous Page | 30 31 32 33 34 35 36 37 38 39 40 41  | Next Page >