15,897,371 members
Sign in
Sign in
Email
Password
Forgot your password?
Sign in with
home
articles
Browse Topics
>
Latest Articles
Top Articles
Posting/Update Guidelines
Article Help Forum
Submit an article or tip
Import GitHub Project
Import your Blog
quick answers
Q&A
Ask a Question
View Unanswered Questions
View All Questions
View C# questions
View C++ questions
View Javascript questions
View Visual Basic questions
View Python questions
discussions
forums
CodeProject.AI Server
All Message Boards...
Application Lifecycle
>
Running a Business
Sales / Marketing
Collaboration / Beta Testing
Work Issues
Design and Architecture
Artificial Intelligence
ASP.NET
JavaScript
Internet of Things
C / C++ / MFC
>
ATL / WTL / STL
Managed C++/CLI
C#
Free Tools
Objective-C and Swift
Database
Hardware & Devices
>
System Admin
Hosting and Servers
Java
Linux Programming
Python
.NET (Core and Framework)
Android
iOS
Mobile
WPF
Visual Basic
Web Development
Site Bugs / Suggestions
Spam and Abuse Watch
features
features
Competitions
News
The Insider Newsletter
The Daily Build Newsletter
Newsletter archive
Surveys
CodeProject Stuff
community
lounge
Who's Who
Most Valuable Professionals
The Lounge
The CodeProject Blog
Where I Am: Member Photos
The Insider News
The Weird & The Wonderful
help
?
What is 'CodeProject'?
General FAQ
Ask a Question
Bugs and Suggestions
Article Help Forum
About Us
Search within:
Articles
Quick Answers
Messages
Comments by Anuragintit (Top 20 by date)
Anuragintit
6-Dec-23 3:56am
View
Unable to cast object of type 'System.Web.UI.WebControls.Label' to type 'System.Web.UI.WebControls.TableCell'.
Anuragintit
24-Mar-21 1:30am
View
NO any exception occurred during debugging..
Anuragintit
19-Feb-20 8:10am
View
due to Client Requirement..
Anuragintit
18-Oct-19 3:07am
View
Thanks, but i solved it with loop taking first as 0 and compre to first row then assign value string then second compare return the true of false.... and so on..
Anuragintit
13-Aug-19 6:33am
View
solved this with adding >= 2 in condition.
Anuragintit
19-Jul-19 7:32am
View
Completed the task with adding below
JObject jsonObj = JObject.Parse(response);
string ServiceRes = jsonObj["ResponseCode"].ToString();
Int32 ID = Convert.ToInt32(jsonObj["MEMBERS"]["M"]);
string RI = jsonObj["MEMBERS"]["RI"].ToString();
string F = jsonObj["MEMBERS"]["F"].ToString();
Anuragintit
19-Jul-19 3:52am
View
i need to take into string or data table and insert into database..
Anuragintit
5-Jul-19 2:48am
View
Exactly, what i need, million thanks
Anuragintit
5-Jul-19 2:10am
View
it is for asp.net c# with sql
Anuragintit
5-Jul-19 2:10am
View
it is for asp.net c# with sql
Anuragintit
21-Jun-19 8:41am
View
Thanks, works fine
Anuragintit
13-May-19 9:21am
View
but why label text not available, where text box value available.
Anuragintit
13-May-19 6:58am
View
i m having drop down in my grid view, and when inserting the data with submit button, my loop start and getting drop down value as null which is selected by user, and when loop reaches to second time i get the drop down value , kindly help to sort out
Anuragintit
10-May-19 8:23am
View
<asp:gridview id="GvList" runat="server" autogeneratecolumns="False" onrowdatabound="GvList_RowDataBound" showfooter="True">
<columns>
<asp:templatefield headertext="Measurement Center Id">
<itemtemplate>
<asp:label id="CenterId" runat="server" text="<%#Eval("CenterId") %>" enabled="false">
<headerstyle width="4%" horizontalalign="Center" cssclass="thead_cell">
<itemstyle horizontalalign="Center" width="4%">
<asp:templatefield headertext="Today Data">
<itemtemplate>
<asp:textbox id="txt_lastyearonDate_Rain" runat="server" text="<%#Eval("py_raintoday") %>" ondrop="return false;" onpaste="return false;"
autocomplete="off">
<controlstyle width="90%">
<headerstyle width="4%" horizontalalign="Center" cssclass="thead_cell">
<itemstyle horizontalalign="Center" width="4%">
<footertemplate>
<asp:label id="lbl_pytoday" runat="server" forecolor="Black" style="display:block; padding:0; text-align: center">
<asp:templatefield headertext="Select Type">
<itemtemplate>
<asp:dropdownlist id="ddl_type" runat="server">
<controlstyle width="100%">
<headerstyle width="3%" horizontalalign="Center" cssclass="thead_cell">
<itemstyle horizontalalign="Center" width="3%">
------------------------------------------------------------------------------------------------
Code Side
protected void GvList_DataBound(object sender, EventArgs e)
{
GridViewRow row = new GridViewRow(0, 0, DataControlRowType.Header, DataControlRowState.Normal);
TableHeaderCell cell = new TableHeaderCell();
cell.Text = "Details";
cell.ColumnSpan = 3;
row.Controls.Add(cell);
cell = new TableHeaderCell();
cell.Text = "Year 2018";
cell.ColumnSpan = 4;
row.Controls.Add(cell);
cell = new TableHeaderCell();
cell.ColumnSpan = 4;
cell.Text = "Year 2019";
row.Controls.Add(cell);
cell = new TableHeaderCell();
cell.Text = "Others";
cell.ColumnSpan = 4;
row.Controls.Add(cell);
// row.BackColor = ColorTranslator.FromHtml("#3AC0F2");
GvList.HeaderRow.Parent.Controls.AddAt(0, row);
}
------------------------Submit click--------------------
foreach (GridViewRow row in GvList.Rows)
{
Label CenterId = (Label)row.FindControl("CenterId") as Label;
string CenterId_no = CenterId.Text;
DropDownList ddl = (DropDownList)row.FindControl("ddl_type") as DropDownList;
string dropdown_value = ddl.SelectedValue;
TextBox txt_lastyearonDate_Rain = (TextBox)row.FindControl("txt_lastyearonDate_Rain") as TextBox;
float py_ondte = float.Parse(txt_lastyearonDate_Rain.Text);
}
-----------------
Anuragintit
10-May-19 8:07am
View
Deleted
<asp:gridview id="GvList" runat="server" autogeneratecolumns="False" onrowdatabound="GvList_RowDataBound" showfooter="True">
<columns>
<asp:templatefield headertext="Measurement Center Id">
<itemtemplate>
<asp:label id="CenterId" runat="server" text="<%#Eval("CenterId") %>" enabled="false">
<headerstyle width="4%" horizontalalign="Center" cssclass="thead_cell">
<itemstyle horizontalalign="Center" width="4%">
<asp:templatefield headertext="Today Data">
<itemtemplate>
<asp:textbox id="txt_lastyearonDate_Rain" runat="server" text="<%#Eval("py_raintoday") %>" ondrop="return false;" onpaste="return false;"
autocomplete="off">
<controlstyle width="90%">
<headerstyle width="4%" horizontalalign="Center" cssclass="thead_cell">
<itemstyle horizontalalign="Center" width="4%">
<footertemplate>
<asp:label id="lbl_pytoday" runat="server" forecolor="Black" style="display:block; padding:0; text-align: center">
<asp:templatefield headertext="Select Type">
<itemtemplate>
<asp:dropdownlist id="ddl_type" runat="server">
<controlstyle width="100%">
<headerstyle width="3%" horizontalalign="Center" cssclass="thead_cell">
<itemstyle horizontalalign="Center" width="3%">
------------------------------------------------------------------------------------------------
Code Side
protected void GvList_DataBound(object sender, EventArgs e)
{
GridViewRow row = new GridViewRow(0, 0, DataControlRowType.Header, DataControlRowState.Normal);
TableHeaderCell cell = new TableHeaderCell();
cell.Text = "Details";
cell.ColumnSpan = 3;
row.Controls.Add(cell);
cell = new TableHeaderCell();
cell.Text = "Year 2018";
cell.ColumnSpan = 4;
row.Controls.Add(cell);
cell = new TableHeaderCell();
cell.ColumnSpan = 4;
cell.Text = "Year 2019";
row.Controls.Add(cell);
cell = new TableHeaderCell();
cell.Text = "Others";
cell.ColumnSpan = 4;
row.Controls.Add(cell);
// row.BackColor = ColorTranslator.FromHtml("#3AC0F2");
GvList.HeaderRow.Parent.Controls.AddAt(0, row);
}
------------------------Submit click--------------------
foreach (GridViewRow row in GvList.Rows)
{
Label CenterId = (Label)row.FindControl("CenterId") as Label;
string CenterId_no = CenterId.Text;
DropDownList ddl = (DropDownList)row.FindControl("ddl_type") as DropDownList;
string dropdown_value = ddl.SelectedValue;
TextBox txt_lastyearonDate_Rain = (TextBox)row.FindControl("txt_lastyearonDate_Rain") as TextBox;
float py_ondte = float.Parse(txt_lastyearonDate_Rain.Text);
}
-----------------
Anuragintit
10-May-19 7:26am
View
<asp:gridview id="GvList" runat="server" autogeneratecolumns="False" onrowdatabound="GvList_RowDataBound" showfooter="True">
<columns>
<asp:templatefield headertext="Measurement Center Id">
<itemtemplate>
<asp:label id="CenterId" runat="server" text="<%#Eval("CenterId") %>" >
<headerstyle width="4%" horizontalalign="Center" cssclass="thead_cell">
<itemstyle horizontalalign="Center" width="4%">
<asp:templatefield headertext="Today Data">
<itemtemplate>
<asp:textbox id="txt_lastyearonDate_Rain" runat="server" text="<%#Eval("py_raintoday") %>" ondrop="return false;" onpaste="return false;"
autocomplete="off">
<controlstyle width="90%">
<headerstyle width="4%" horizontalalign="Center" cssclass="thead_cell">
<itemstyle horizontalalign="Center" width="4%">
<footertemplate>
<asp:label id="lbl_pytoday" runat="server" forecolor="Black" style="display:block; padding:0; text-align: center">
<asp:templatefield headertext="Select Type">
<itemtemplate>
<asp:dropdownlist id="ddl_type" runat="server">
<controlstyle width="100%">
<headerstyle width="3%" horizontalalign="Center" cssclass="thead_cell">
<itemstyle horizontalalign="Center" width="3%">
------------------------------------------------------------------------------------------------
Code Side
protected void GvList_DataBound(object sender, EventArgs e)
{
GridViewRow row = new GridViewRow(0, 0, DataControlRowType.Header, DataControlRowState.Normal);
TableHeaderCell cell = new TableHeaderCell();
cell.Text = "Details";
cell.ColumnSpan = 3;
row.Controls.Add(cell);
cell = new TableHeaderCell();
cell.Text = "Year 2018";
cell.ColumnSpan = 4;
row.Controls.Add(cell);
cell = new TableHeaderCell();
cell.ColumnSpan = 4;
cell.Text = "Year 2019";
row.Controls.Add(cell);
cell = new TableHeaderCell();
cell.Text = "Others";
cell.ColumnSpan = 4;
row.Controls.Add(cell);
// row.BackColor = ColorTranslator.FromHtml("#3AC0F2");
GvList.HeaderRow.Parent.Controls.AddAt(0, row);
}
------------------------Submit click--------------------
foreach (GridViewRow row in GvList.Rows)
{
Label CenterId = (Label)row.FindControl("CenterId") as Label;
string CenterId_no = CenterId.Text;
DropDownList ddl = (DropDownList)row.FindControl("ddl_type") as DropDownList;
string dropdown_value = ddl.SelectedValue;
TextBox txt_lastyearonDate_Rain = (TextBox)row.FindControl("txt_lastyearonDate_Rain") as TextBox;
float py_ondte = float.Parse(txt_lastyearonDate_Rain.Text);
}
-----------------
Anuragintit
10-May-19 7:06am
View
Getting year on this, part, it shows input not in correct form, as it is blank for first time
Label lbl_lastyear_beforedate = (Label)row.FindControl("lbl_lastyear_beforedate") as Label;
float PY_Bdte = float.Parse(lbl_lastyear_beforedate.Text);
Anuragintit
23-Apr-19 5:35am
View
Many Thanks @OriginalGriff, working fine....
Anuragintit
23-Apr-19 4:06am
View
sorry for previous comment, i think it is helpful , let me try..thankss..........
Anuragintit
23-Apr-19 4:00am
View
Deleted
Thanks but this not so simple, bcoz, this is a tender process that is if any one getting tender for 1-25 KM , and if he travel for 2 KM then the rate must be calculate by Lead id for 1-25 and not for 1-8.
Show More