Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > ASP .Net > ASP .Net Datagrid Control > checkbox databind does not work

Reply
Thread Tools

checkbox databind does not work

 
 
Jim
Guest
Posts: n/a
 
      01-05-2005
i am trying to bind a checkbox to a tablecolumn available (integer)

i get an error:

'The best overloaded method match for Company.Customers.fbool(int)' has some
invalid arguments'


datagrid:

<aspataGrid..>

<Columns>

<asp:TemplateColumn HeaderText="available">
<ItemTemplate>
<asp:CheckBox id="cbAvailable"
Checked='<%#fbool(DataBinder.Eval(Container, "DataItem.available"))%>'
Runat="server"></asp:CheckBox>
</ItemTemplate>
</asp:TemplateColumn>



<Columns>

</aspataGrid..>



fbool function:

public string fbool(int i)

{

if (i==1)

{

return "true";

}

else

{

return "false";

}

}



thanks



Jim


 
Reply With Quote
 
 
 
 
Jim
Guest
Posts: n/a
 
      01-05-2005
nevermind got it
"Jim" <(E-Mail Removed)> wrote in message
news:(E-Mail Removed)...
> i am trying to bind a checkbox to a tablecolumn available (integer)
>
> i get an error:
>
> 'The best overloaded method match for Company.Customers.fbool(int)' has

some
> invalid arguments'
>
>
> datagrid:
>
> <aspataGrid..>
>
> <Columns>
>
> <asp:TemplateColumn HeaderText="available">
> <ItemTemplate>
> <asp:CheckBox id="cbAvailable"
> Checked='<%#fbool(DataBinder.Eval(Container, "DataItem.available"))%>'
> Runat="server"></asp:CheckBox>
> </ItemTemplate>
> </asp:TemplateColumn>
>
>
>
> <Columns>
>
> </aspataGrid..>
>
>
>
> fbool function:
>
> public string fbool(int i)
>
> {
>
> if (i==1)
>
> {
>
> return "true";
>
> }
>
> else
>
> {
>
> return "false";
>
> }
>
> }
>
>
>
> thanks
>
>
>
> Jim
>
>



 
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
How do you databind a CheckBox? aualias ASP .Net 11 04-29-2011 10:31 AM
checkbox databind =?Utf-8?B?cm9kY2hhcg==?= ASP .Net 5 11-10-2006 05:59 PM
Does GridView.DataBind work under medium trust with custom objects =?Utf-8?B?TWFyayBMZWlzdG5lcg==?= ASP .Net 3 08-22-2006 11:13 PM
checkbox databind does not work jasonkester ASP .Net 5 01-05-2005 04:42 AM
BUG in DataBind? After .DataBind there are more DataGrid Items than DataSet Rows! Michael ASP .Net Datagrid Control 0 12-29-2003 07:47 PM



Advertisments