Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > ASP .Net > ASP .Net Datagrid Control > Create Columns at run time

Reply
Thread Tools

Create Columns at run time

 
 
Tina
Guest
Posts: n/a
 
      10-02-2005
if you place a datagrid on a form and then, in Property builder, check the
box saying Create Columns at run time. An then do a SQL Select into a
datatable, and then bind the datatable to the grid, the grid displays
correctly. BUT, the columns array is empty. The grid displays just fine.
There are cells and rows but no columns.

I want to make some of the columns non visible but I can't because there are
no columns.

Why is this?
Thanks,
Tina


 
Reply With Quote
 
 
 
 
Scott M.
Guest
Posts: n/a
 
      10-02-2005
If the columns are going to be made automatically at run-time, then you
can't modify them at design-time.

If you are going to want to configure aspects of the columns yourself, then
you'll need to un-check "Create columns automatically at run time." and
manually add columns yourself.

I suggest adding Bound columns first and configuring each to be bound to the
appropriate data field from your data source. After they are created and
working, I would then click the link in the bottom of the Property Builder
to "Convert to Template Column", so that you can get even more control over
the configuration of the columns.



"Tina" <(E-Mail Removed)> wrote in message
news:(E-Mail Removed)...
> if you place a datagrid on a form and then, in Property builder, check the
> box saying Create Columns at run time. An then do a SQL Select into a
> datatable, and then bind the datatable to the grid, the grid displays
> correctly. BUT, the columns array is empty. The grid displays just fine.
> There are cells and rows but no columns.
>
> I want to make some of the columns non visible but I can't because there
> are no columns.
>
> Why is this?
> Thanks,
> Tina
>



 
Reply With Quote
 
 
 
 
Tina
Guest
Posts: n/a
 
      10-02-2005
I Can't do what you say because my program is a SQLTable Update Utility. I
don't know what the columns will be at design time.

I'm "Creating the columns at run time" via a databind which does indeed
create the grid correctly but the Columns array is nothing i.e.
Datagrid1.columns(0) is out of bounds.

It seems the columns array should be there. the Headertext is even there
which is an attribute of the columns in the array.

What is really odd is related to another thread you replied to where my
datagrid was empty in a subsequent button click event. It was because I had
the Create columns checkbox checked!!!!!!!! When I unchecked it, my grid
had all of its rows and data in the button event. I think thats a bug in
the grid componnet.
T

"Scott M." <(E-Mail Removed)> wrote in message
news:(E-Mail Removed)...
> If the columns are going to be made automatically at run-time, then you
> can't modify them at design-time.
>
> If you are going to want to configure aspects of the columns yourself,
> then you'll need to un-check "Create columns automatically at run time."
> and manually add columns yourself.
>
> I suggest adding Bound columns first and configuring each to be bound to
> the appropriate data field from your data source. After they are created
> and working, I would then click the link in the bottom of the Property
> Builder to "Convert to Template Column", so that you can get even more
> control over the configuration of the columns.
>
>
>
> "Tina" <(E-Mail Removed)> wrote in message
> news:(E-Mail Removed)...
>> if you place a datagrid on a form and then, in Property builder, check
>> the box saying Create Columns at run time. An then do a SQL Select into
>> a datatable, and then bind the datatable to the grid, the grid displays
>> correctly. BUT, the columns array is empty. The grid displays just
>> fine. There are cells and rows but no columns.
>>
>> I want to make some of the columns non visible but I can't because there
>> are no columns.
>>
>> Why is this?
>> Thanks,
>> Tina
>>

>
>



 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Run-time template list definition / Run-time variable type definition Pierre Yves C++ 2 01-10-2008 02:52 PM
DataGrid Columns Created at Run time Gary Blakely ASP .Net 0 10-07-2005 04:24 PM
Create Columns at run time Tina ASP .Net 0 10-02-2005 12:46 AM
sortcommand for columns created at run time lien ASP .Net 0 10-18-2004 05:55 PM
How to add columns to a grid dynamically at run time? Ahmet Gunes ASP .Net Web Controls 1 09-15-2003 03:57 PM



Advertisments