Jump to content
Xtreme .Net Talk

Recommended Posts

Posted

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.

Posted

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

Hamlet
Posted

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.

Posted
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.
Posted

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

  • 2 weeks later...

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...