469,609 Members | 1,168 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 469,609 developers. It's quick & easy.

Row selection and highlighting using Web Control Datagrid?

I have been looking and looking but can't seem to find out how to get the row
selected in a web control datagrid (NOT a web form datagrid!!!), and how to
highlight the selected row. I'm sure this question comes up all the time but
I can't find the solution(s) anywhere. From what I understand, the web
control datagrid doesn't have any row selected or row highlighting
capabilities. What kind of hack am I going to have to put into place?
Sample code would be greatly appreciated. Thanks again!
Nov 17 '05 #1
2 2469
Hi,

What is the difference between a web control datagrid and a web form
datagrid?

You can use the SelectedItemStyle and SelectedItem/SelectedIndex properties.
cheers,

--
Ignacio Machin,
ignacio.machin AT dot.state.fl.us
Florida Department Of Transportation

"Carolyn Vo" <Ca*******@discussions.microsoft.com> wrote in message
news:90**********************************@microsof t.com...
I have been looking and looking but can't seem to find out how to get the
row
selected in a web control datagrid (NOT a web form datagrid!!!), and how
to
highlight the selected row. I'm sure this question comes up all the time
but
I can't find the solution(s) anywhere. From what I understand, the web
control datagrid doesn't have any row selected or row highlighting
capabilities. What kind of hack am I going to have to put into place?
Sample code would be greatly appreciated. Thanks again!

Nov 17 '05 #2
Sorry, I meant web control DataGrid vs windows form DataGrid. There are
differences between the two:

Windows Forms versus Web Forms DataGrid Control

The Web Forms DataGrid control is not the same as the Windows Forms
equivalent. It is a common (and not unreasonable) assumption that they are
the same control, or at least have identical functionality. However, the
entire programming paradigm for Web Forms is quite different from that for
Windows Forms. For example, Web Forms pages perform a round trip to the
server for any processing; they must manage state; they feature a very
different data-binding model; and so on.

Because of these differences, there are also significant differences in
their respective controls, including the DataGrid control. As a general rule,
the Web Forms DataGrid control includes less built-in functionality. A few
examples of differences in the Web Forms DataGrid control are:

* It does not inherently support master-detail data structures.
* As with other Web server controls, it does not support two-way data
binding. If you want to update data, you must write code to do this yourself.
* You can only edit one row at a time.
* It does not inherently support sorting, although it raises events you
can handle in order to sort the grid contents.

On the other hand:

* You can bind the Web Forms DataGrid to any object that supports the
IEnumerable interface.
* The Web Forms DataGrid control supports paging.
* It is easy to customize the appearance and layout of the Web Forms
DataGrid control as compared to the Windows Forms one. (Details are provided
later in this paper.)
Nov 17 '05 #3

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

2 posts views Thread by Srinath Avadhanula | last post: by
3 posts views Thread by Aidan | last post: by
4 posts views Thread by Jeff Bangert | last post: by
2 posts views Thread by ___Newbie___ | last post: by
reply views Thread by back2grid | last post: by
1 post views Thread by Bob Loveshade | last post: by
1 post views Thread by B-Dog | last post: by
reply views Thread by devrayhaan | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.