Ask a Question related to ASP.NET Data Grid Control, Design and Development.
-
Paul D. Fox #1
Need to manipulate a column before displaying
I am setting a datagrid's Datasource to a Dataset returned from a Web Service. However, I need to manipulate one of the columns. The column being returned is a relative URL, so I need to prefix the column's data with the first part of the URL to make it an Absolute URL. How can I do this so the datagrid column displays this? I'm thinking something like...
dgDatagrid.DataSource = ListAllDocuments.PTDocRetrieve(txtPTFolderID.Text)
dgDatagrid.DataBind()
'************************************************* *******
'strPTReturnURI will have the value http://machineName/server.pt"
'************************************************* *******
'I need to prefix the column with a string from strItem, this of course doesn't work, but you get the idea
strItem = strPTReturnURI & dgDatagrid.Items(6).DataItem
dgDatagrid.Items(6).DataItem() = strItem
Paul
Paul D. Fox Guest
-
Summing a column and displaying in the footer
I would like to sum a column in my dataset and have it displayed at the bottom of the datagrid in the footer. How do I do that? -
Empty Column not displaying correctly
Hi, I have a datagrid where the first column is a Select button and the next 5 columns are databound. I bind the grid to a dataset that conains... -
EditItemTemplate column not displaying on first EditCommand click
For some reason, when I click the edit template command button on my grid, the edit command fires, but the edit template controls don't display. ... -
Problem displaying one column of one row from a database with PHP.
I have a small script with PHP that queries a MySQL database to pull out one row, where I want to be able to access each of the columns separately.... -
displaying XML data in datagrid column
i want to display actual XML data (with tags & data) from a table's colum (XML data) in a datagrid's column... by default it shows only yhe... -
Scott Mitchell [MVP] #2
Re: Need to manipulate a column before displaying
Paul D. Fox wrote:
You have a couple of options. One option is to use an ItemTemplate and> I am setting a datagrid's Datasource to a Dataset returned from a Web
> Service. However, I need to manipulate one of the columns. The column
> being returned is a relative URL, so I need to prefix the column's data
> with the first part of the URL to make it an Absolute URL. How can I do
> this so the datagrid column displays this?
call a helper method, passing in the URL field and manipulating it in
your method. You can see this method described in more detail here:
[url]http://datawebcontrols.com/faqs/CustomizingAppearance/CustomizeColumnValue.shtml[/url]
You could also modify the value in the ItemDataBound event. More info at:
[url]http://datawebcontrols.com/faqs/CustomizingAppearance/ConditionalFormatting.shtml[/url]
hth
--
Scott Mitchell [ASP.NET MVP]
[email]mitchell@4GuysFromRolla.com[/email]
[url]http://www.4GuysFromRolla.com/ScottMitchell[/url]
Scott Mitchell [MVP] Guest
-
Paul D. Fox #3
Re: Need to manipulate a column before displaying
Thanks Scott, I already figured out the first approach. However, your
second approach is pretty cool.
Paul
"Scott Mitchell [MVP]" <mitchell@4guysfromrolla.com> wrote in message
news:8bLYe.3463$Ba2.3318@newssvr27.news.prodigy.ne t...> Paul D. Fox wrote:>>> I am setting a datagrid's Datasource to a Dataset returned from a Web
>> Service. However, I need to manipulate one of the columns. The column
>> being returned is a relative URL, so I need to prefix the column's data
>> with the first part of the URL to make it an Absolute URL. How can I do
>> this so the datagrid column displays this?
> You have a couple of options. One option is to use an ItemTemplate and
> call a helper method, passing in the URL field and manipulating it in your
> method. You can see this method described in more detail here:
> [url]http://datawebcontrols.com/faqs/CustomizingAppearance/CustomizeColumnValue.shtml[/url]
>
> You could also modify the value in the ItemDataBound event. More info at:
> [url]http://datawebcontrols.com/faqs/CustomizingAppearance/ConditionalFormatting.shtml[/url]
>
>
> hth
>
>
> --
>
> Scott Mitchell [ASP.NET MVP]
> [email]mitchell@4GuysFromRolla.com[/email]
> [url]http://www.4GuysFromRolla.com/ScottMitchell[/url]
Paul D. Fox Guest



Reply With Quote

