DataGrid woes!!!

R

Rookie

Hi,

I had some trouble using the DataGrid control in VC#. Any C#/DataGrid
gurus out there please help!! Thanks.

I have a DataGrid with just one DataTable which I populate when the
App. comes up (by reading the contents of an .ini file)

1.)Now once the Form is displayed, when the user clicks on a cell in
the DataGrid - firstly I want the entire row to be selected and not
just that cell. By selected I mean that the entire row should be
highlighted with some color.

2.)I want the cells to be uneditable. I tried changing the
this.dataTable1.DefaultView.AllowEdit = false; but still the cell
background is shown in gray and the text is highlighted with blue and
there is a cursor in the cell. I don't want the text in the cell to be
highlighted and I don't need the cursor there.

3.)Also is there any event for row selection, 'cuz once a row is
selected by clicking on a cell in that row - I want to display all the
cells from that row?

4.) When there are no rows to be populated when the app. first comes
up. It still shows an empty row and if I click on any cell in that row
it makes the contents of all the cells = (null). I don't want this row
to be displayed. If there are no rows I just want to display the
column headers. Also when I add a row to the table, besides the row I
just added, it shows an empty row at the end as well. How do I get rid
of this row too?

Hope to hear from someone soon. Thanks in advance
 
A

Arne Janning

Rookie said:
Hi,

I had some trouble using the DataGrid control in VC#. Any C#/DataGrid
gurus out there please help!! Thanks.

I have a DataGrid with just one DataTable which I populate when the
App. comes up (by reading the contents of an .ini file)

1.)Now once the Form is displayed, when the user clicks on a cell in
the DataGrid - firstly I want the entire row to be selected and not
just that cell. By selected I mean that the entire row should be
highlighted with some color.
http://www.syncfusion.com/FAQ/WinForms/FAQ_c44c.asp#q689q

2.)I want the cells to be uneditable. I tried changing the
this.dataTable1.DefaultView.AllowEdit = false; but still the cell
background is shown in gray and the text is highlighted with blue and
there is a cursor in the cell. I don't want the text in the cell to be
highlighted and I don't need the cursor there.
http://www.syncfusion.com/FAQ/WinForms/FAQ_c44c.asp#q1008q

3.)Also is there any event for row selection, 'cuz once a row is
selected by clicking on a cell in that row - I want to display all the
cells from that row?
http://www.syncfusion.com/FAQ/WinForms/FAQ_c44c.asp#q785q

4.) When there are no rows to be populated when the app. first comes
up. It still shows an empty row and if I click on any cell in that row
it makes the contents of all the cells = (null). I don't want this row
to be displayed. If there are no rows I just want to display the
column headers. Also when I add a row to the table, besides the row I
just added, it shows an empty row at the end as well. How do I get rid
of this row too?

http://www.syncfusion.com/FAQ/WinForms/FAQ_c44c.asp#q653q


Cheers

Arne Janning
 

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