|
Yup I agree with you.
The code is as below:
if (e.Row.RowType == DataControlRowType.DataRow )
{
DataRowView rowView = (DataRowView)e.Row.DataItem;
string Code = rowView["CODE"].ToString();
}
Thie fist row doesn't match the condition as row type is DataControlRowType.Header.
But the first row has some data and i want the fist row shouldnt be a DataControlRowType.Header.
Does this helps you to solve the problem
Pavas
|
|
|
|
|
You can choose to remove the header from the GridView if you don't want it at all.
I have tried writing similar lines in my code. I didn't get any error with DataRowView rowView = (DataRowView)e.Row.DataItem . Now I'm thinking that maybe the data binding was not done properly for the GridView? If the data binding was not done, DataItem would be empty and the cast (DataRowView)e.Row.DataItem could thrown an error. I don't see what else could be wrong. Maybe someone can provide a fresh perspective.
Talal
"Programming today is a race between software engineers striving to build bigger and better idiot-proof programs, and the Universe trying to produce bigger and better idiots. So far, the Universe is winning."
--Rich Cook
|
|
|
|
|
I am not sure why this is happening...? Could some one help on this
Pavas
|
|
|
|
|
Hi guys how to creat note pad in runtime in asp.net plz give some sample code
Praveen Kumar.R
|
|
|
|
|
Your question is illogical. You can't create a notepad in ASP.NET, because you can't save files locally. You can trivially add a text control, and save the contents to the server, however. What do you mean by 'in runtime'. What is it you want to do ?
Christian Graus - Microsoft MVP - C++
"I am working on a project that will convert a FORTRAN code to corresponding C++ code.I am not aware of FORTRAN syntax" ( spotted in the C++/CLI forum )
|
|
|
|
|
Did U mean text editor ?
U should use javascript to ceate that.
www.fckeditor.net
Hope this will help U
Regard,
Edwin
|
|
|
|
|
hi,
below this is the code written in C#.net .i want the correspond vb.net code. thanks in advance...
" string distict = ((DropDownList)MyGridView.FooterRow.FindControl("ddlDistrict")).SelectedValue.ToString().Trim();"
where MyGrid=id of the gridview
ddlDistrict=id of the ddl which is taken in side the footer template of gridview
|
|
|
|
|
Please don't cross post.
Christian Graus - Microsoft MVP - C++
"I am working on a project that will convert a FORTRAN code to corresponding C++ code.I am not aware of FORTRAN syntax" ( spotted in the C++/CLI forum )
|
|
|
|
|
dim distict as string=ctype(MyGridView.FooterRow.FindControl("ddlDistrict"),DropDownList).SelectedValue.ToString().Trim()
Best regard
Pathan
---------------------------------------------------
|
|
|
|
|
Hi friends
I need validation expression string for 'XXX XXX' format
Thanks In advance
pathan
---------------------------------------------------
|
|
|
|
|
What do the X's mean ? you probably mean you need to build a regex ? Expresso is a great tool for that.
Christian Graus - Microsoft MVP - C++
"I am working on a project that will convert a FORTRAN code to corresponding C++ code.I am not aware of FORTRAN syntax" ( spotted in the C++/CLI forum )
|
|
|
|
|
Use Regular Expression Validator.
\s{3} \s{4}
|
|
|
|
|
Thanks
Pathan
---------------------------------------------------
|
|
|
|
|
hi,
This is the regular expression for U.S Phone number(XXX-XXX-XXXX)
((\(\d{3}\) ?)|(\d{3}-))?\d{3}-\d{4}
You can edit it and use it for your work accordingly..
SHWETA!!
|
|
|
|
|
Thanks
Pathan
---------------------------------------------------
|
|
|
|
|
Hi guys, iam using session in my project some session variables are interger some other string. when session expired i click next button they show error, so i want to validate when session is expired. so please give some ideas how to validate
Praveen Kumar.R
|
|
|
|
|
The best you can do is work out in your pages that it has timed out, and redirect to the login page.
Christian Graus - Microsoft MVP - C++
"I am working on a project that will convert a FORTRAN code to corresponding C++ code.I am not aware of FORTRAN syntax" ( spotted in the C++/CLI forum )
|
|
|
|
|
Before getting the data from the Session first check is not null.
Parwej Ahamad
g.parwez@gmail.com
|
|
|
|
|
praveenkumar_mca wrote: so i want to validate when session is expired.
As Christian told you need to validate session existence on each page_load. It could be something like
if ( session["yoursessionvalue"] == null)
Response.Redirect("Loginpage");
|
|
|
|
|
Check the session value in page load. If it is null then redirect the login page showing the message that your session is time out.
|
|
|
|
|
Why is it that suddenly so many questions get the same answer given over and over again ?
Christian Graus - Microsoft MVP - C++
"I am working on a project that will convert a FORTRAN code to corresponding C++ code.I am not aware of FORTRAN syntax" ( spotted in the C++/CLI forum )
|
|
|
|
|
Respected Gurus
I have to export a datagrid to excel in asp.net1.1
my code is:---
Private Sub btnExport_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnExport.Click
Response.ContentType = "application/vnd.ms-excel"
' Remove the charset from the Content-Type header.
Response.Charset = ""
' Turn off the view state.
Me.EnableViewState = False
'Dim tw As New System.IO.StringWriter
tw = New System.IO.StringWriter
'Dim hw As New System.Web.UI.HtmlTextWriter(tw)
hw = New System.Web.UI.HtmlTextWriter(tw)
' Get the HTML for the control.
DataGrid1.RenderControl(hw)
' Write the HTML back to the browser.
Response.Write(tw.ToString())
' End the response.
Response.End()
End Sub
whenever i run this code i got the error message that control datagrid1_....
must be placed inside a form tag with runat=server.
how to resolve it as all the controls are inside the form tag and runat=server attribute is also there.
Plz suggest.
|
|
|
|
|
check it
"http://www.codeproject.com/aspnet/DAtaGridExportToExcel.asp"
|
|
|
|
|
Hi,
As per the requirement of my application I need to download file from ftp server and copy the data to the database automatically.
I am using ASP.NET and I have downloaded file. How can I copy data to database.
Database is SQL Server 2005.
Please let me know asap..
Thanks a lot!!
SHWETA!!
|
|
|
|
|
shweta@syscom wrote: am using ASP.NET and I have downloaded file. How can I copy data to database.
I presume that you have downloaded file to server or any other location where ASP.NET account is having read/write permissions. Read the file and convert it to binary data. Store it in BLOB field of your table.
|
|
|
|