thomas10001 Posted July 28, 2003 Posted July 28, 2003 I have a DataGrid where I have set column styles to my column in the DataGrid. When I am using the column style I cannot add a new row to the datagrid. (If I dont use any column styles it works fine to add a new row) What can be wrong? If I am looking at my CurrencyManager in the debugger after I have added a new row the differences are two: Using column style onItemChanged <undefine value> onMetaDataChangedHandler <undefined value> Without column style onItemChanged {System.Window.Forms.ItemChangedEventHandler} OnMetaDataChangedHandler {System.EventHandler} Is it something with this two that the problem arises for? Or can it be something else.? Is it something extra needed to bet set when adding the column style? I am just using an example in the .NET help so set the column style. Quote
donnacha Posted July 28, 2003 Posted July 28, 2003 A few questions to ask yourself to try and address the problem. 1-What are you using as your datasource:- dataview, dataset/datatable 2-How are you adding the row to your datagrid 3-Have you set the databinding Quote Hamlet
thomas10001 Posted July 28, 2003 Author Posted July 28, 2003 That is not the problem. It is working perfect without the columnstyles. Quote
donnacha Posted July 29, 2003 Posted July 29, 2003 How do you add the row, programatically or is the user entering it in the datagrid. Quote Hamlet
thomas10001 Posted July 29, 2003 Author Posted July 29, 2003 The user add the row to the datagrid which has an ArrayList as datasource. Then the row is added through the currencymanager. If I remove all columnstyles it works fine. I have the same problem on datagrids with dataset as the datasource too. Quote
thomas10001 Posted July 31, 2003 Author Posted July 31, 2003 I found the solution. Since I am using an ArrayList as datasource I had to set DataSource = null before adding the new row otherwise no visual effect. Then it has to be set to the arraylist after wards, which I already knew. Quote
jahan Posted July 31, 2003 Posted July 31, 2003 I have a similar problem with the width of data showing up on my datagrid. I use a datatable to populate my datagrid, but the grid shows the default width per column. Is there a way to change the width of a column and also change the alignment of each column (currently s/b right justify) ,etc. thankx Quote
donnacha Posted August 12, 2003 Posted August 12, 2003 Hi jahan, just use the datatablestyles and you can do all that. Quote Hamlet
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.