DataGrid Columns

Results 1 to 2 of 2

Thread: DataGrid Columns

  1. #1
    Join Date
    Dec 1969

    Default DataGrid Columns

    I have VB.NET, and I like many of the GUI features. I am trying to manually create columns for a DataGrid (autogeneratecolumns = "false") and see two techniques, but not the one I was hoping for:<BR><BR>I see a GUI technique, by right clicking on the DataGrid control and setting properties ... I don&#039;t favor this?<BR><BR>I have sucessfully altered the HTML view by adding the &#060;Columns&#062; tags and filling them accordingly. I don&#039;t favor this, but it&#039;s ok?<BR><BR>I was hoping for a means of editing a DataGrid Columns collection in VB code. I don&#039;t see this? <BR><BR>IS THIS POSSIBLE?

  2. #2
    Join Date
    Dec 1969

    Default RE: DataGrid Columns

    It&#039;s possible, but trust me, you don&#039;t want to do it. To see the complexity of the code needed to generate the special datagrid columns, create a very simple ASP.NET Web page that does nothing but bind an array (or DataReader or whatever) to a DataGrid that has some custom columns set using &#060;Columns&#062;. Then, introduce a run-time error (by adding something like: Dim x as int in your server-side code (assuming you are NOT using code-behind)). When you view the ASP.NET Web page you will get an error (int not defined) and you can click on a link to see the complete source code. It&#039;s VERY ugly.<BR><BR>So stick with the &#060;Columns&#062; approach, IMO it&#039;s the best bet.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts