Hi, I have a grid (4 rows x 5 columns). I need to sort grid by last column. But I want to trace what changes were made to row order. I need this info to: 1. Change row header's text 'cause it doesn't change automatically during sort. 2. Change the columns order, i.e. I have rows 1,2,3,4. After sorting I have 2,3,1,4. And I want my columns moved in that way: 2,3,1,4 (with DisplayedIndex property for example)
anton 09
Posts
-
Custom sorting -
Arrow in rowheaderI solved the problem. As my CellPainting has already been overriden, I added such construction to clear the arrow: using (Brush backColorBrush = new SolidBrush(e.CellStyle.BackColor)) { e.Graphics.FillRectangle(backColorBrush, e.CellBounds.X+1, e.CellBounds.Y+1, 20,40); }
-
Arrow in rowheaderHave you another decision besides DataGridView to show information in table-style?
-
Arrow in rowheaderEditing glyph IS NOT the black arrow, showing the row selected! The question is still actual. And I think the solution is to draw in row header. But what exactly? I'm sure somebody had already fixed this issue.
-
Arrow in rowheaderHi, I want to get rid of black arrow in rowheader of DataGridView. Any ideas?
-
Editing DataGridViewImageCell?Hi, what modifications should I do to add "editing" functionality to DataGridViewImageCell. I need a cell that has Image external representation and Text internal representation. I know how to get a Text string from Image name and vice versa for my case. What class should I derive from and what I need to modify?
-
Help with data updateHello, could anyone solve my problem. I have application working with MSSQL Server: there is one table "goods" (id, name) and another one - "info" (id, idgood1, idgood2, info), where idgood1 and idggod2 - foreign keys. That is an example of what I want. "Goods" Table:
id | name --------- 23 | foo1 24 | foo2 25 | foo3
"Info" Table:
id | idgood1 | idgood2 | info ----------------------------- 10 | _____23 | _____24 | inf1 11 | _____23 | _____25 | inf2 12 | _____24 | _____25 | inf3
I want to see in DataGridView such structure (first row - row header, first column - column header):
____ | foo1 | foo2 | foo3 -------------------------- foo1 | ____ | inf1 | inf2 foo2 | ____ | ____ | inf3 foo3 | ____ | ____ | ____
I select data from two tables ("goods", "info") in appropriate DataTable instances: GoodsDataTable and InfoDataTable. Then I CREATE (dynamically) one more DataTable instance - VisualDataTable, which is filled according to my needs. Then I put VisualDataTable into DataSet, DataSet into BindingSource, and, finally, BindingSource into DataGridView. It's working. Until I want to update something! I tried to call SqlAdapter's Update method as for InfoDataTable as DataSet. But nothing happens. In general, how should I update data in case when "visual" part of DataGridView and database structure are different..? Another words, I take data from database, and put data into database with one table, and I edit data with another table.
-
Help with data updateOK, I'll show an example "Goods" Table:
id | name --------- 23 | foo1 24 | foo2 25 | foo3
"Info" Table:
id | idgood1 | idgood2 | info ----------------------------- 10 | _____23 | _____24 | inf1 11 | _____23 | _____25 | inf2 12 | _____24 | _____25 | inf3
I want to see in DataGridView such structure (first row - row header, first column - column header):
____ | foo1 | foo2 | foo3 -------------------------- foo1 | ____ | inf1 | inf2 foo2 | ____ | ____ | inf3 foo3 | ____ | ____ | ____
-
Help with data updateHello, could anyone solve my problem. I have application working with MSSQL Server: there is one table "goods" (id, name) and another one - "info" (id, idgood1, idgood2, info), where idgood1 and idggod2 - foreign keys. In my application I need to present a DataGridView in such a way, _______| goods1 | goods2 | goods3 goods1 | info11 | ______ | ______ goods2 | ______ | ______ | info23 goods3 | info31 | ______ | info33 I select data from two tables ("goods", "info") in appropriate DataTable instances: GoodsDataTable and InfoDataTable. Then I CREATE (dynamically) one more DataTable - VisualDataTable, which IS what i need. Then I put VisualDataTable into DataSet, DataSet into BindingSource, and, finally, BindingSource into DataGridView. It's working. Until I want to update something! I tried to call SqlAdapter's Update method as for InfoDataTable as DataSet. But nothing happens. In general, how should I update data in case when "visual" part of DataGridView and database structure are different..? Another words, I take data from database, and put data into database with one table, and I edit data with another table.