Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > ASP .Net > ASP .Net Datagrid Control > conditional id datagrid column

Reply
Thread Tools

conditional id datagrid column

 
 
DC Gringo
Guest
Posts: n/a
 
      02-18-2004
I have a simple datagrid, created by the VS.NET designer and need to output
the value of "0" (zero) if the value is null in the clnPopulationCensus
column.

Here's my front end code:

<asp:BoundColumn DataField="clnPopulationCensus"
SortExpression="clnPopulationCensus" HeaderText="Population (Census)"
DataFormatString=""></asp:BoundColumn>

Would this go in the DataFormatString column? Or somewhere else?




Here's my adapter:

'SqlDataAdapter1
'
Me.SqlDataAdapter1.SelectCommand = Me.SqlSelectCommand1
Me.SqlDataAdapter1.TableMappings.AddRange(New
System.Data.Common.DataTableMapping() {New
System.Data.Common.DataTableMapping("Table", "sac1SelectSurvey1", New
System.Data.Common.DataColumnMapping() {New
System.Data.Common.DataColumnMapping("clnGUID", "clnGUID"), New
System.Data.Common.DataColumnMapping("clnPriorityC orrectedTC",
"clnPriorityCorrectedTC"), New
System.Data.Common.DataColumnMapping("clnMADoneTC" , "clnMADoneTC"), New
System.Data.Common.DataColumnMapping("clnMASchoolT C", "clnMASchoolTC"), New
System.Data.Common.DataColumnMapping("clnMAPosterT C", "clnMAPosterTC"), New
System.Data.Common.DataColumnMapping("clnMARadioTC ", "clnMARadioTC"), New
System.Data.Common.DataColumnMapping("clnMAPerform ingGroupTC",
"clnMAPerformingGroupTC"), New
System.Data.Common.DataColumnMapping("clnMACommuni tyCenterTC",
"clnMACommunityCenterTC"), New
System.Data.Common.DataColumnMapping("clnMAReligio usOrganizationTC",
"clnMAReligiousOrganizationTC"), New
System.Data.Common.DataColumnMapping("clnMAOtherTC ", "clnMAOtherTC"), New
System.Data.Common.DataColumnMapping("clnMAOther", "clnMAOther"), New
System.Data.Common.DataColumnMapping("clnMAOrganis ation",
"clnMAOrganisation")}), New System.Data.Common.DataTableMapping("Table1",
"Table1", New System.Data.Common.DataColumnMapping() {New
System.Data.Common.DataColumnMapping("clnGUID", "clnGUID"), New
System.Data.Common.DataColumnMapping("clnName", "clnName")})})


_____
DC G


 
Reply With Quote
 
 
 
 
Alvin Bruney [MVP]
Guest
Posts: n/a
 
      03-02-2004
Your post went unanswered. Have you resolved this issue?

--
Regards,
Alvin Bruney [ASP.NET MVP]
Got tidbits? Get it here...
http://tinyurl.com/3he3b
"DC Gringo" <(E-Mail Removed)> wrote in message
news:u6$(E-Mail Removed)...
> I have a simple datagrid, created by the VS.NET designer and need to

output
> the value of "0" (zero) if the value is null in the clnPopulationCensus
> column.
>
> Here's my front end code:
>
> <asp:BoundColumn DataField="clnPopulationCensus"
> SortExpression="clnPopulationCensus" HeaderText="Population (Census)"
> DataFormatString=""></asp:BoundColumn>
>
> Would this go in the DataFormatString column? Or somewhere else?
>
>
>
>
> Here's my adapter:
>
> 'SqlDataAdapter1
> '
> Me.SqlDataAdapter1.SelectCommand = Me.SqlSelectCommand1
> Me.SqlDataAdapter1.TableMappings.AddRange(New
> System.Data.Common.DataTableMapping() {New
> System.Data.Common.DataTableMapping("Table", "sac1SelectSurvey1", New
> System.Data.Common.DataColumnMapping() {New
> System.Data.Common.DataColumnMapping("clnGUID", "clnGUID"), New
> System.Data.Common.DataColumnMapping("clnPriorityC orrectedTC",
> "clnPriorityCorrectedTC"), New
> System.Data.Common.DataColumnMapping("clnMADoneTC" , "clnMADoneTC"), New
> System.Data.Common.DataColumnMapping("clnMASchoolT C", "clnMASchoolTC"),

New
> System.Data.Common.DataColumnMapping("clnMAPosterT C", "clnMAPosterTC"),

New
> System.Data.Common.DataColumnMapping("clnMARadioTC ", "clnMARadioTC"), New
> System.Data.Common.DataColumnMapping("clnMAPerform ingGroupTC",
> "clnMAPerformingGroupTC"), New
> System.Data.Common.DataColumnMapping("clnMACommuni tyCenterTC",
> "clnMACommunityCenterTC"), New
> System.Data.Common.DataColumnMapping("clnMAReligio usOrganizationTC",
> "clnMAReligiousOrganizationTC"), New
> System.Data.Common.DataColumnMapping("clnMAOtherTC ", "clnMAOtherTC"), New
> System.Data.Common.DataColumnMapping("clnMAOther", "clnMAOther"), New
> System.Data.Common.DataColumnMapping("clnMAOrganis ation",
> "clnMAOrganisation")}), New System.Data.Common.DataTableMapping("Table1",
> "Table1", New System.Data.Common.DataColumnMapping() {New
> System.Data.Common.DataColumnMapping("clnGUID", "clnGUID"), New
> System.Data.Common.DataColumnMapping("clnName", "clnName")})})
>
>
> _____
> DC G
>
>



 
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
bind a dropdown in a column in a datagrid based on the dropdown value selected in another column of the datagrid. vishnu ASP .Net 1 03-25-2006 01:24 PM
? ELSE Conditional Comment / Using Conditional Comments Inside Other Tags To Comment Out Attributes Alec S. HTML 10 04-16-2005 02:21 AM
how do i access a dropdownlists selected value in a datagrid edititemtemplate column from the selectedindexchanged event of another dropdownlist in a datagrid edititemtemplate column Dave M ASP .Net Datagrid Control 0 12-14-2004 11:53 AM
Add column to the last column of Datagrid Hai Nguyen ASP .Net 0 01-16-2004 10:10 PM
How to bind a db image column (byte array) to a datagrid column? Jim Hammond ASP .Net 1 11-26-2003 12:55 AM



Advertisments