here is its VB.NET equivalent..
 
Dim i As DataGridItem
For Each i In dgUsers.Items
 i.ToolTip = "Test"
 cb1 = CType(i.FindControl("chkPush"), CheckBox)    
 cb1.Checked = False
 if(sRBText=cb1.ClientID)
 {
   cb1.Checked = True
   AdvID = i.Cells(4).Text.ToString()
   ViewState("advid") = AdvID
   Exit For
  }
Next

Cheers,
Sandeep
Anna Leon <[EMAIL PROTECTED]> wrote:

Anyone mind converting to vb.net? That's what I'm
using...


--- Amogh Lachake wrote:

> Hii,
> 
> try using something of this sort...
> 
> 
> foreach(DataGridItem i in dgUsers.Items)
> {
> i.ToolTip = "Test";
> cb1 = (CheckBox) i.FindControl("chkPush"); 
> cb1.Checked = false;
> if(sRBText==cb1.ClientID)
> {
> cb1.Checked = true;
> AdvID = i.Cells[4].Text.ToString();
> ViewState["advid"] = AdvID;
> break;
> }
> }
> 
> 
> On Thu, 14 Oct 2004 17:32:34 -0400, Rajendra Appalla
> wrote:
> > Lets say the button the user presses after the
> user selects the row of
> > the correct address is "btn".
> > 
> > btn.Attributes.Add("onclick", "return
> CheckBoxConfirm(this.form);");
> > 
> > You can add a client side java script function
> that checks whether the
> > user checked atleast one check box in the datagrid
> or not as below:
> > 
> > I hope you are using Template columns for the
> checkbox column in the
> > datagrid. Lets say the ID of the checkbox is:
> "chkSelect".
> > 
> > function CheckBoxConfirm (frm)
> > {
> > var flag = false;
> > 
> > for (i=0; i> > { 
> > // Look for our checkboxes
> only
> > if
> (frm.elements[i].name.indexOf('chkSelect') !=
> > -1) 
> > {
> > // If any are
> checked then confirm
> > alert, otherwise nothing happens
> > 
> if(frm.elements[i].checked) 
> > {
> > 
> flag = true;
> > 
> return confirm ('Are you
> > sure you want to delete your selection(s)?')
> > 
> > } 
> 
> > }
> > }// end of for loop.
> > 
> > alert('You have to Select at least one
> row. \n\n\n You can
> > Select row(s) by checking corresponding
> CheckBox(es).');
> > return flag;
> > }
> > 
> > 
> > You need to make sure that the user selects not
> more than one checkbox.
> > You can tweak above script to do that.
> > 
> > I am assuming that you assign the primary key
> field of the table to the
> > DataKeyField property of the datagrid.
> > 
> > In the btn_click event, you can get the primary
> key id of the row of
> > which the checkbox is clicked as follows:
> > 
> > foreach(DataGridItem gridItem in
> dgTableView.Items)
> > {
> > CheckBox chk = (CheckBox)
> > gridItem.FindControl("chkSelect");
> > if(chk.Checked)
> > {
> > intPKID =
> >
>
Convert.ToInt32(dataGrid.DataKeys[gridItem.ItemIndex]);
> > break;
> > 
> > }
> > }
> > 
> > 
> > Pass this primary key id to the form and in the
> form query the database
> > to get the values of the columns you need to
> display in the form.
> > 
> > Rajendra.
> > 
> > 
> > 
> > 
> > 
> > 
> > 
> > 
> > 
> > 
> > 
> > 
> > 
> > 
> > -----Original Message-----
> > From: sas0riza [mailto:[EMAIL PROTECTED] 
> > Sent: Thursday, October 14, 2004 3:27 PM
> > To: [EMAIL PROTECTED]
> > Subject: [AspNetAnyQuestionIsOk] Populating a Form
> > 
> > 
> > Hi,
> > 
> > I'm using a search form to find an address. I then
> return it to the 
> > screen in a datagrid. I've added a checkbox column
> and I want the 
> > user to check the correct address and hit a
> button. How do I write 
> > the code to see which checkbox was selected?
> > 
> > After clicking the button, I want to take the row
> that the user 
> > selected (address) and populate it into a form.
> How do I populate a 
> > form from fields in the database?
> > 
> > Thanks.
> > 
> > 
> > 
> > 
> > 
> > 
> > Yahoo! Groups Sponsor
> > ADVERTISEMENT
> > click here
> >
>
> >
>
D=groups/S=1705006764:HM/EXP=1097868438/A=2372354/R=0/SIG=12id813k2/*htt
> >
>
ps:/www.orchardbank.com/hcs/hcsapplication?pf=PLApply&media=EMYHNL40F210
> > 04SS> 
> > 
> >
>
> > s/S=:HM/A=2372354/rand=719079343> 
> > 
> > _____ 
> > 
> > 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]
> >
>
> > cribe> 
> > 
> > * Your use of Yahoo! Groups is subject to
> the Yahoo! Terms of
> > Service . 
> > 
> > 
> > [Non-text portions of this message have been
> removed]
> > 
> > 
> > 
> > 
> > 
> > Yahoo! Groups Sponsor
> > 
> > ADVERTISEMENT
> > 
> > 
> > ________________________________
> > 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 the Yahoo!
> Terms of Service.
> 




_______________________________
Do you Yahoo!?
Declare Yourself - Register online to vote today!
http://vote.yahoo.com




Yahoo! Groups Links








                
---------------------------------
Do you Yahoo!?
vote.yahoo.com - Register online to vote today!

[Non-text portions of this message have been removed]



------------------------ 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