|
Often the controls are not in the cells you expect. So you may need to try some different cell numbers before you find them.
Try
Cells[1]...Cells[2] etc
Hope that helps.
Ben
|
|
|
|
|
Hi,
Instead of finding control in the cell you can find the conrol in the row of the grid.
You can do like following.
Label lbl = (Label)gv.Rows[0].FindControl("lableid");
I hope this will help you.
Thanks and Regards,
Chetan Ranpariya
|
|
|
|
|
Hi i actually happpen to find the control but the text is saying blank..
I have used databind to do the binding instead of template controls and it is working now..but just thought that it might work out....
|
|
|
|
|
How to acess textbox which is in template of datagrid control
|
|
|
|
|
In the OnDataBound or OnItemCreated (and probably a few others) events you can use something like:
e.Item.FindControl("ControlID")
The control doesn't exist until the datagrid is databound so theres no way to access it outside these events.
|
|
|
|
|
Hi,
I cant seem to find a way to do the above. I have 4 columns in a grid view. My HeaderTemplate consists of an asp:checkbox, I would like to add text to this checkbox rather than just a tooltip, but if I add text it makes my first column in the grid far too wide!
Im sure there is a way to do this!
Please help.
Thanks
Janet
|
|
|
|
|
Eh? You want to add text to the header but not increase its size? How would that work?
|
|
|
|
|
I want to span the header text so that it displays accross 3 columns!
Not sure if there is a way to do this or not?
|
|
|
|
|
hi,
The following code may help you.
void gv_RowDataBound(object sender, GridViewRowEventArgs e)
{
if (e.Row.RowType == DataControlRowType.Header)
{
e.Row.Cells[0].ColumnSpan = 3;
e.Row.Cells[1].Visible = false;
e.Row.Cells[2].Visible = false;
CheckBox chk = (CheckBox)e.Row.FindControl("chk");
chk.Text = "your text";
}
}
I hope this will help you.
Thanks and Regards,
Chetan Ranpariya
|
|
|
|
|
Many thanks for the code snippet.
Janet
|
|
|
|
|
I Have a image field in Sql Server 2005.
I want to feach that image and display it to the image control
how i do it.
ajeet
|
|
|
|
|
Ajeet mittal wrote: feach
means fetch ?
Regards,
Sylvester G
sylvester_g_m@yahoo.com
|
|
|
|
|
Tahe a look at this article
http://www.codeproject.com/cs/database/ImageSaveInDataBase.asp[^]
I had same requirement in one of my prejects i converted the while image in bytes and store it in database then while retriving the image you need bitmap that will convert byte to bit map image simple
Thanks and Regards
Sandeep
If If you look at what you do not have in life, you don't have anything,
If you look at what you have in life, you have everything... "
|
|
|
|
|
Hi I am working on a website where I want code for Upload File......
Means there is a textbox and two button......
After clicking browse button File browser will appear and
a file select as user wish and after that
by clicking update button file get uploaded
at specific location at website......
Please try to help me......
Thanks
Rajesh Jain
Rajesh Jain
|
|
|
|
|
|
Thanks a lot Prakash-B......
It is very useful for me......
-Rajesh Jain
|
|
|
|
|
Hi all,
I am novice to ASP.NET. I am studying ASP.NET(coding in VB.NET) using .NET 2003 version with SQL SERVER 2000
I am working on Login Authentication. I am supposed to maintain Users account with login session for every user, i.e. I need to take care of session started after logging in till the user logout from his account.
How to create and maintain session in ASP.NET ?
I would appreciate if anyone could sort out this difficulty.
Thank you.
Prodigy.
P.S - I am aorking on ASP.NET 2003 using VB.Net and SQL Server 2000
|
|
|
|
|
Session("userName") = assign your user name
by this way you can maintain the username untill your session get expire.
Thanks
Warm Regards
Prakash-B
|
|
|
|
|
In Login page Assign values to Session Varaible such as Seesion["UserName"]="Some Value" ok now check this session in every page load
if it is null then redirect it to login page
so that if user log out and click back button he should able to access anything
Thanks and Regards
Sandeep
If If you look at what you do not have in life, you don't have anything,
If you look at what you have in life, you have everything... "
|
|
|
|
|
HI all,
I am using password recovery control of ASP.Net 2.0 and i want to customize the email received from the control, Can came body suggest me how to do that..
Thanks
Regards
|
|
|
|
|
how can i connect database using web.config in .net 2005
|
|
|
|
|
Inside the <Configuration> tag, make a new tag called <ConnectionStrings>.
Within that, make one like this:
<add name="(name)" connectionString="(connectionString)" providerName="(providerName)" />
Of course, you'd want to put in your actual name, connectionString, and providerName, rather than the parenthesized example above.
For example:
<configuration>
<appSettings/>
<connectionStrings>
<add name="DatabaseConnection" connectionString="Data Source=.\SQLEXPRESS;AttachDbFilename=|DataDirectory|\Database.mdf;Integrated Security=True;User Instance=True"
providerName="System.Data.SqlClient" />
</connectionStrings>
|
|
|
|
|
please make clear the data source.. i am using sql server 2000..
thks
|
|
|
|
|
These things you can easily find on GOOGLE Remember If you want to absorb new concept you should explore it on GOOGLE first then if found any issue or didn't understand then you can ask those things in such forums. That its mean.
Thanks and Regards
Sandeep
If If you look at what you do not have in life, you don't have anything,
If you look at what you have in life, you have everything... "
|
|
|
|
|
Might there by chance be a method to detect the width of the browser (or even the screen resolution) with ASP.NET?
I tried HttpCapabilitiesBase.ScreenWidthPixels, but I get NullReferenceException when I run it.
I'll use javascript if I have to, but I'd prefer to stick with the ASP.NET.
Thanks ahead of time.
|
|
|
|