Jump to content
Xtreme .Net Talk

Recommended Posts

Posted

I have a datagrid, which is bound to a datatable with 4 or 5 columns, which in turn gets its data through a function from an xml document. now i need to have an ID column for things the datagrid the does, but don't want it to be visible. i tried using:

 

mydatagrid.columns(1).visible = false

 

but since the columns are bound at runtime, they appear when the page runs, but if i have it count the columns, the only one it knows is the one created at design time with the "select" button in each row. so is there a way to keep a bound column there, but make it invisible to the user?

Posted
I have a datagrid, which is bound to a datatable with 4 or 5 columns, which in turn gets its data through a function from an xml document. now i need to have an ID column for things the datagrid the does, but don't want it to be visible. i tried using:

 

mydatagrid.columns(1).visible = false

 

but since the columns are bound at runtime, they appear when the page runs, but if i have it count the columns, the only one it knows is the one created at design time with the "select" button in each row. so is there a way to keep a bound column there, but make it invisible to the user?

So this is a row ID?

or a common ID, where it is the same ID for every row in the column?

Joe Mamma

Amendment 4: The right of the people to be secure in their persons, houses, papers, and effects, against unreasonable searches and seizures, shall not be violated, and no warrants shall issue, but upon probable cause, supported by oath or affirmation, and particularly describing the place to be searched, and the persons or things to be seized.

Amendment 9: The enumeration in the Constitution, of certain rights, shall not be construed to deny or disparage others retained by the people.

Posted
This is a row ID (remember that the it needs to remain consistent with the row it represents even when i sort, change pages), but unless there's a special way of assigning IDs (is there?), i'm not sure why that should matter.
Posted
but it doesn't! ive tried it tons of times & it can see the column created @ design time (w/ the select button) but if i have it tell me the number of columns in the grid, it only sees 1. it shows the other ones but i can't make them invisible.
Posted

the only thing is maybe i'm putting it in the wrong place... here's where i've been putting it:

 

datagrid1.datasource = showdata()

datagrid1.databind

datagrid1.columns(1).visible = false (i get an error here)

Posted

i found this on MSDN: "When using both, explicitly declared columns will be rendered first, followed by the automatically generated columns. Automatically generated columns are not added to the Columns collection." (http://msdn.microsoft.com/library/default.asp?url=/library/en-us/cpref/html/frlrfsystemwebuiwebcontrolsdatagridclasscolumnstopic.asp)

 

Mine are automatically generated so how do i make those invisible?

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...