GridView Help - Pretty desperate..!

F

Family Tree Mike

vaib said:
Kindly have a look at this. I know it's wrong to cross-post but I need
this one badly.

http://groups.google.com/group/micr...csharp/browse_thread/thread/400b102187a5884a#

For whatever reason, I see your post on Google, but not MS. Anyways...

It appears that you have some controls, like textboxes, that you want to
mirror in a gridview. So if I type "Boo!" in textbox 1, then the
gridview should show | textBox1 | Boo! |.

You then go on and describe that since the textbox and other controls
are added dynamically, that they don't have ID's, and as such, you
cannot write the "textBox1" part.

If I understand what your trying to do, I'm confused why the dynamic
controls don't have ID's. Aren't you doing this in code:

TextBox tb = new TextBox();
tb.Width = Unit.Pixel(100);
tb.ID = "textBox1";
 
M

Mansi Shah

Hi,

You can loop the gridview and find the type of control like this..

if(this.FindControl("MyControl").getType() == typeof(TextBox))
{
Response.Write("Textbox");
}

You can loop the gridview for the controls it contain, and can just find
the type of it..

Hope this will help.

Regards,
Mansi Shah
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top