Burak, you need to handle the DataGrid_DataBound event and in that method add code to 
check the # of rows and the value of the rows in the DataSource.  In that method you 
can then make the checkbox visible=false if necessary.

Greg Ewing [MVP]
www.citidc.com


Original Message:
>From: Burak Gunay <[EMAIL PROTECTED]>
>To: [EMAIL PROTECTED]
>Subject: [AspNetAnyQuestionIsOk] How to disable checkbox in datagrid?
>Date: Mon, 17 May 2004 09:22:01 -0700 (PDT)

>
> Hello,
>
> I have a datagrid made up of two columns, the first
>has a checkbox in it and the other holds a job id.
>
><Columns>                      
><asp:TemplateColumn HeaderText="Select"
>HeaderStyle-HorizontalAlign="Center"
>ItemStyle-HorizontalAlign="Center">
><ItemTemplate>
><asp:CheckBox ID="chkIncomplete" Runat="server">
></asp:CheckBox>
></ItemTemplate>
></asp:TemplateColumn>
><asp:BoundColumn HeaderText="VJC Ref#"
>SortExpression="JOB_ID" DataField="JOB_ID"
>HeaderStyle-HorizontalAlign="Center"
>ItemStyle-HorizontalAlign="Center"></asp:BoundColumn>
></columns>                                     
>
> When there are no job ids, I insert a blank row into
>the grid from the code behind
>
> row(1) = "No active job orders have been saved"
> ds.Tables(0).Rows.InsertAt(row, 0)
> dtgActive.DataSource = ds.Tables(0)
> dtgActive.DataBind()
>
>when I do this however, the checkbox also shows up.
>
> How can I prevent the checkbox from showing up?
>
> Thank you,
>
> Burak
>
>
>       
>               
>__________________________________
>Do you Yahoo!?
>SBC Yahoo! - Internet access at a great low price.
>http://promo.yahoo.com/sbc/
>
>
>
> 
>Yahoo! Groups Links
>
>
>
> 
>
>
>




------------------------ Yahoo! Groups Sponsor ---------------------~-->
Make a clean sweep of pop-up ads. Yahoo! Companion Toolbar.
Now with Pop-Up Blocker. Get it for free!
http://us.click.yahoo.com/L5YrjA/eSIIAA/yQLSAA/saFolB/TM
---------------------------------------------------------------------~->

 
Yahoo! Groups Links

<*> To visit your group on the web, go to:
     http://groups.yahoo.com/group/AspNetAnyQuestionIsOk/

<*> To unsubscribe from this group, send an email to:
     [EMAIL PROTECTED]

<*> Your use of Yahoo! Groups is subject to:
     http://docs.yahoo.com/info/terms/
 

Reply via email to