DataGrid Problems

  • Thread starter Srinivasa Raghavan S
  • Start date
S

Srinivasa Raghavan S

Hi

I am having problems in using DataGrid.I have extended
the DataGrid to have ComboBox,Numeric TextBox and Date
Time Picker as the Datagrid Columns.I have binded the
Datatable to datagrid as dataSource.I have another Grid
which also has combo box.Whenever I Scroll through the
first Grid,drop down automatically appears in the second
DataGrid.There is no relation between first an second
grid.Base Edit of the extended Combo box is getting called
for the two grids twice.


Also any one can suggest what is the best practices for
adding row/editing row in datagrid.Whether we should leave
to it dataGrid to create new rows or handle through
dataview/datatable.


Please suggest me a solution for this.


Thanks
Srinivasa Raghavan
 
T

Tim Wilson [MVP]

Are you using the same data source for your two DataGrid's? In other words,
have you bound the same DataView (or DataTable) to both DataGrid's? If this
is what you have done then try creating two different views of the DataTable
and that should help:

DataView viewDataGrid1 = new DataView(dataTable1);
this.dataGrid1.DataSource = viewDataGrid1;
DataView viewDataGrid2 = new DataView(dataTable1);
this.dataGrid2.DataSource = viewDataGrid2;
Also any one can suggest what is the best practices for
adding row/editing row in datagrid.Whether we should leave
to it dataGrid to create new rows or handle through
dataview/datatable.
In my opinion, it all depends on the user (or intended users - target
audience) of the application. To some people it might not be too intuitive
to click on the last row to add a new entry, even if you tell them explicity
in the application this is what is to be done. To people who have used Excel
clicking on the last row seems logical, but to others it can sometimes be a
source of confusion. So if your target audience might not be confortable in
this type of environment then you might want to set up sometime of form to
allow the user to enter in information and then add this information into a
new DataRow for them. And, of course, you still have another option of
adding the DataRow to the DataTable, when the user clicks an "Add" button
for example, and then direct the user to fill in the appropriate information
in the new row in the DataGrid. So I think that this all comes down to what
is best, and most comfortable, for the end users. This is not always an easy
thing to predict if you are just commercially marketing your application,
but generally speaking all users should be happy with a form based entry or
clicking an "Add" button as (I find) that these are more straight forward
and intuitive approaches than clicking on the last row.

HTH
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top