Hi there,
I've inherited a project that makes use of various Telerik controls throughout, but none moreso than RadGrids. For the most part the grids are declared and defined in the ASPX files and all their formatting set there, however what I want to do is move away from that and instead set them up in the code behind. I've spent the last hour looking through your site and the various pages, however nothing adequately provides answers to what I'm trying to do.
I call a stored procedure from a database and store the result in the dataset. The dataset therefore contains all the information I need and I can easily dump this out in to an ASP GridView control and manipulate it however I want. The rest of the project however is using the RadGrids, so I'm trying to do the very same thing with a RadGrid. To do this I did the following:
The problems I have began when I found the dataset I get back from the database had two columns in it that I didn't want to display. I assumed it would be as simple as setting the .Visible property on the two columns to false so the Grid wouldn't display them, however every attempt I've made to find exactly WHERE these columns are bound has resulted in errors. I've tried rgdTable.Columns and rgdTable.MasterTableView.Columns, along with looking in the DetailTables, and they always return a count of 0. If the columns ARE being bound and ARE being displayed, why is it that I can't access them programmatically?
Both of these (run individually, not together obviously) return a column count of 0. So where ARE these columns being bound to exactly? I need to be able to access them once they're bound to the grid to be able to change them as I see fit.
Any help you could provide would be appreciated.
I've inherited a project that makes use of various Telerik controls throughout, but none moreso than RadGrids. For the most part the grids are declared and defined in the ASPX files and all their formatting set there, however what I want to do is move away from that and instead set them up in the code behind. I've spent the last hour looking through your site and the various pages, however nothing adequately provides answers to what I'm trying to do.
I call a stored procedure from a database and store the result in the dataset. The dataset therefore contains all the information I need and I can easily dump this out in to an ASP GridView control and manipulate it however I want. The rest of the project however is using the RadGrids, so I'm trying to do the very same thing with a RadGrid. To do this I did the following:
rgdTable.DataSource = myDataSet.Tables(
"myTable"
)
rgdTable.DataBind()
The problems I have began when I found the dataset I get back from the database had two columns in it that I didn't want to display. I assumed it would be as simple as setting the .Visible property on the two columns to false so the Grid wouldn't display them, however every attempt I've made to find exactly WHERE these columns are bound has resulted in errors. I've tried rgdTable.Columns and rgdTable.MasterTableView.Columns, along with looking in the DetailTables, and they always return a count of 0. If the columns ARE being bound and ARE being displayed, why is it that I can't access them programmatically?
DisplayInfo.InnerHtml =
"<p>Master Table Column Count: "
& rgdTable.MasterTableView.Columns.Count &
"</p>"
DisplayInfo.InnerHtml =
"<p>RadGrid Column Count: "
& rgdTable.Columns.Count &
"</p>"
Both of these (run individually, not together obviously) return a column count of 0. So where ARE these columns being bound to exactly? I need to be able to access them once they're bound to the grid to be able to change them as I see fit.
Any help you could provide would be appreciated.