15,880,651 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 Rashid Choudhary (Top 52 by date)
Rashid Choudhary
7-Oct-13 4:21am
View
first row of my table is blank
Rashid Choudhary
3-Jan-13 1:57am
View
aspx
<asp:GridView ID="GridView1" runat="server" AutoGenerateColumns="False"
CellPadding="3" ForeColor="#333333" GridLines="None"
CellSpacing="4" Width="92%" Visible="False" BorderColor="#DEBA84"
BackColor="#DEBA84" BorderStyle="None" BorderWidth="1px" AllowPaging="True"
onpageindexchanging="GridView1_PageIndexChanging" DataKeyNames="P_id"
onrowdatabound="GridView1_RowDataBound"
>
<columns>
<asp:BoundField HeaderText="Username" DataField="Uname" />
<asp:BoundField HeaderText="Product name" DataField="Product_name" />
<asp:BoundField HeaderText="Product Quantity" DataField="Product_quan" />
<asp:BoundField HeaderText="Delivery Date (MM/DD/YYYY)" DataField="Delivery_date" />
<asp:BoundField HeaderText="Extend Date (MM/DD/YYYY)" DataField="Extend_date" />
<asp:BoundField HeaderText="Product Information" DataField="check_bit" />
<asp:TemplateField>
<itemtemplate>
<asp:LinkButton ID="click" runat="server" Text="Dispatch">
<asp:TemplateField>
<itemtemplate>
<asp:LinkButton ID="lnkbtn" runat="server" Text="InvDisp" ForeColor="Blue">
<footerstyle backcolor="#990000" font-bold="True" forecolor="White">
<PagerStyle BackColor="#FFCC66" ForeColor="#333333" HorizontalAlign="Center" />
<SelectedRowStyle BackColor="#FFCC66" Font-Bold="True" ForeColor="White" BorderColor="#738A9C" />
<HeaderStyle BackColor="#A55129" Font-Bold="True" ForeColor="White" Height="30%" />
<alternatingrowstyle backcolor="White">
.cs
protected void GridView1_RowDataBound(object sender, GridViewRowEventArgs e)
{
if (e.Row.RowType == DataControlRowType.DataRow)
{
DataRowView row = (DataRowView)e.Row.DataItem;
string eid = ((LinkButton)e.Row.FindControl("click")).Text;
string lnkbtn = ((LinkButton)e.Row.FindControl("lnkbtn")).Text;
string param = "challan_report.aspx?P_id=" + row["P_id"] + "&Uname=" + row["Uname"];
((LinkButton)e.Row.FindControl("click")).Attributes.Add("OnClick", "window.open('" + param + "','PopupWindow','toolbar=no, location=no, directories=no,titlebar=no, status=no, menubar=no,resizable=NO,scrollbars=NO,copyhistory=no,width=600,height=600,top=20,left=20')");
string caram = "Invoice.aspx?P_id=" + row["P_id"] + "&Uname=" + row["Uname"];
((LinkButton)e.Row.FindControl("lnkbtn")).Attributes.Add("OnClick", "window.open('" + caram + "','PopupWindow','toolbar=no, location=no, directories=no,titlebar=no, status=no, menubar=no,resizable=NO,scrollbars=NO,copyhistory=no,width=600,height=600,top=20,left=20')");
}
}
Rashid Choudhary
15-Oct-12 5:57am
View
<Web:ChartControl ID="ChartControl1" runat="server" BorderStyle="None" BorderWidth="2px"
Width="800px" HasChartLegend="False" Height="700px" ChartPadding="50" LeftChartPadding="20"
TopPadding="40" Padding="20">
<yaxisfont stringformat="Far,Near,Character,LineLimit" font="Tahoma, 8pt, style=Bold">
<xtitle stringformat="Center,Near,Character,LineLimit" font="Tahoma, 10pt, style=Bold">
<charttitle stringformat="Center,Near,Character,LineLimit" font="Arial, 14pt, style=Bold">
<xaxisfont stringformat="Center,Near,Character,LineLimit" font="Tahoma, 8pt, style=Bold">
<background color="LightSteelBlue" centercolor="DimGray" endpoint="200, 100" hatchstyle="DottedGrid">
<ytitle stringformat="Center,Near,Character,DirectionVertical" font="Tahoma, 10pt,style=Bold">
Rashid Choudhary
15-Oct-12 5:57am
View
Deleted
<Web:ChartControl ID="ChartControl1" runat="server" BorderStyle="None" BorderWidth="2px"
Width="800px" HasChartLegend="False" Height="700px" ChartPadding="50" LeftChartPadding="20"
TopPadding="40" Padding="20">
<yaxisfont stringformat="Far,Near,Character,LineLimit" font="Tahoma, 8pt, style=Bold">
<xtitle stringformat="Center,Near,Character,LineLimit" font="Tahoma, 10pt, style=Bold">
<charttitle stringformat="Center,Near,Character,LineLimit" font="Arial, 14pt, style=Bold">
<xaxisfont stringformat="Center,Near,Character,LineLimit" font="Tahoma, 8pt, style=Bold">
<background color="LightSteelBlue" centercolor="DimGray" endpoint="200, 100" hatchstyle="DottedGrid">
<ytitle stringformat="Center,Near,Character,DirectionVertical" font="Tahoma, 10pt,style=Bold">
Rashid Choudhary
8-Oct-12 8:07am
View
my first table
item_code stock_on_hand Product_name
P001 4 T
P002 3 P
P003 3 L
and second table is
Collapse | Copy Code
Product_name Product_quan Delivery_date Uname P_id Extend_date st_bit flag check_bit item_code
1 T 1 2012-10-22 00:00:00.000 nitin123 16 2012-10-30 0 0 0 P001
2 P 2 2012-10-22 00:00:00.000 nitin123 17 NULL 0 0 1 P002
3 L 1 2012-10-25 00:00:00.000 nitin123 18 NULL 0 0 0 P003
4 P 3 2012-10-22 00:00:00.000 nupur123 19 NULL 0 0 1 P002
5 L 2 2012-10-26 00:00:00.000 nupur123 20 NULL 0 0 1 P003
6 L 2 2012-10-20 00:00:00.000 nitin123 21 2012-10-30 0 0 0 P003
7 T 3 2012-10-23 00:00:00.000 nupur123 22 NULL 0 0 1 P001
i want the table o/p is
item_code stock_on_hand Product_name
P001 7 T
P002 11 P
P003 6 L
Rashid Choudhary
8-Oct-12 7:10am
View
Deleted
my query gives exact answer
Rashid Choudhary
5-Oct-12 3:55am
View
not working same prob occured
Rashid Choudhary
4-Oct-12 1:35am
View
quantity add with stock on hand with same product name
Rashid Choudhary
4-Oct-12 1:30am
View
yes
Rashid Choudhary
4-Oct-12 1:23am
View
my table is
Product_name Product_quan Delivery_date Uname P_id Extend_date st_bit flag check_bit
b 1 2012-08-13 nupur123 135 2012-10-04 1 0 1
c 4 2012-08-22 nupur123 136 2012-10-03 0 0 1
b 1 2012-09-03 priya@21 143 2012-09-27 1 0 0
a 2 2012-08-31 priya@21 144 1900-01-01 0 0 0
c 5 2012-09-18 priya@21 145 1900-01-01 1 0 0
a 1 2012-09-03 nupur123 146 NULL 1 0 0
b 1 2012-09-04 nitin123 148 NULL 1 0 0
and second table is
item_code Product_name stock_on_hand
1 a 4
2 b 5
3 c 8
Reply
Rashid Choudhary - 1 sec ago
and my prob is that when check_bit is change 0 to 1 then in second table automatically
add product_quan with stock_on_hand
Rashid Choudhary
4-Oct-12 1:22am
View
Deleted
and my prob is that when check_bit is change 0 to 1 then in second table automatically
add product_quan with stock_on_hand
Rashid Choudhary
4-Oct-12 1:20am
View
Deleted
my table is
Product_name Product_quan Delivery_date Uname P_id Extend_date st_bit flag check_bit
b 1 2012-08-13 nupur123 135 2012-10-04 1 0 1
c 4 2012-08-22 nupur123 136 2012-10-03 0 0 1
b 1 2012-09-03 priya@21 143 2012-09-27 1 0 0
a 2 2012-08-31 priya@21 144 1900-01-01 0 0 0
c 5 2012-09-18 priya@21 145 1900-01-01 1 0 0
a 1 2012-09-03 nupur123 146 NULL 1 0 0
b 1 2012-09-04 nitin123 148 NULL 1 0 0
and second table is
item_code Product_name stock_on_hand
1 a 4
2 b 5
3 c 8
Rashid Choudhary
4-Oct-12 1:04am
View
not work properly
Rashid Choudhary
28-Sep-12 5:04am
View
thannnnxxxxxxxxx to help
Rashid Choudhary
28-Sep-12 4:51am
View
Deleted
i already try this but same problem
Rashid Choudhary
28-Sep-12 4:46am
View
protected void Button1_Click(object sender, EventArgs e)
{
buildgrid();
Grid1.Visible = true;
gvDetails.Visible = false;
}
public void buildgrid()
{
da = new SqlDataAdapter("bofc_prod", con);
ds1 = new DataSet();
da.Fill(ds1);
Grid1.DataSource = ds1.Tables[0];
Grid1.DataBind();
Grid1.Visible = true;
}
and in proc
select a.U_id,b.P_id, b.Product_name,b.Product_quan,b.check_bit,b.Delivery_date,b.Extend_date from Client_registration_tbl a , Product_order b where a.Uname= b.Uname
Rashid Choudhary
28-Sep-12 4:34am
View
Deleted
Product_name Product_quan Delivery_date Uname P_id Extend_date st_bit flag check_bit
Pitbull 1 2012-08-13 nupur123 135 2012-10-05 1 0 1
LoGate 4 2012-08-22 nupur123 136 2012-10-03 0 0 1
Pitbull 1 2012-09-03 priya@21 143 2012-09-27 1 0 1
Trackmagic 2 2012-08-31 priya@21 144 1900-01-01 0 0 1
LoGate 5 2012-09-18 priya@21 145 NULL 1 0 1
Trackmagic 1 2012-09-03 nupur123 146 NULL 1 0 0
Pitbull 1 2012-09-04 nitin123 148 NULL 1 0 0
Trackmagic 2 2012-09-07 nitin123 149 NULL 1 0 0
LoGate 2 2012-09-19 nitin123 150 NULL 0 0 0
Trackmagic 5 2012-10-10 nupur123 152 NULL 1 0 0
Trackmagic 3 2012-09-26 lavanya 153 NULL 0 0 0
Pitbull 2 2012-09-14 nitin000 157 NULL 0 0 0
Trackmagic 4 2012-09-22 nupur123 158 NULL 0 0 0
LoGate 3 2012-09-27 nupur123 161 NULL 1 0 0
Pitbull 2 2012-09-28 nitin000 162 NULL 1 0 0
Pitbull 3 2012-10-03 nitin000 163 NULL 0 0 0
Rashid Choudhary
28-Sep-12 4:33am
View
Product_name varchar(50) Checked
Product_quan int Unchecked
Delivery_date date Checked
Uname varchar(50) Checked
P_id int Unchecked
Extend_date date Checked
st_bit int Checked
flag int Checked
check_bit varchar(10) Checked
Unchecked
Rashid Choudhary
28-Sep-12 4:27am
View
DataTable dt = ViewState["checkbox1"] as DataTable;
if(dt.Rows.Count>0 && dt!=null)//null reference exception
{
then write code here .
}
Rashid Choudhary
28-Sep-12 3:47am
View
i use ur code but same exeption
Rashid Choudhary
28-Sep-12 3:31am
View
by using row command .i pass a value 1 for checkbox checked to database.
Rashid Choudhary
28-Sep-12 3:29am
View
varchar
Rashid Choudhary
28-Sep-12 3:12am
View
protected void Grid1_RowCommand1(object sender, GridViewCommandEventArgs e)
{
foreach (GridViewRow row in Grid1.Rows)
{
CheckBox chkBx = (CheckBox)row.FindControl("checkbox1");
GridViewRow myRow = (GridViewRow)chkBx.Parent.Parent; // the row
GridView myGrid = (GridView)sender; // the gridview
string ID = myGrid.DataKeys[myRow.RowIndex].Values[0].ToString();
if (chkBx.Checked == true)
{
string s = "update Product_order set check_bit='1' where P_id='" + ID + "'";
cmd = new SqlCommand(s, con);
cmd.ExecuteNonQuery();
}
}
}
protected void Grid1_RowDataBound(object sender, GridViewRowEventArgs e)
{
DataTable dt = ViewState["checkbox1"] as DataTable;
if (e.Row.RowType == DataControlRowType.DataRow)
{
CheckBox checkbox1 = (CheckBox)e.Row.FindControl("checkbox1");
Boolean check_bit = Convert.ToBoolean(dt.Rows[e.Row.RowIndex]["check_bit"].ToString());
if (check_bit == true)
{
checkbox1.Checked = true;
}
}
}
and column name is check_bit
Rashid Choudhary
28-Sep-12 3:10am
View
i send u full code plzzz tell me what prob is occured
Rashid Choudhary
28-Sep-12 3:08am
View
i give column name but same exeption is occured
Rashid Choudhary
28-Sep-12 2:54am
View
this code is give a null refrence exception
protected void Grid1_RowDataBound(object sender, GridViewRowEventArgs e)
{
DataTable dt = ViewState["checkbox1"] as DataTable;
if (e.Row.RowType == DataControlRowType.DataRow)
{
CheckBox checkbox1 = (CheckBox)e.Row.FindControl("checkbox1");
Boolean check_bit = Convert.ToBoolean(dt.Rows[e.Row.RowIndex]["Checkbox1"].ToString());//null reference exeption
if (check_bit == true)
{
checkbox1.Checked = true;
}
}
}
Rashid Choudhary
28-Sep-12 1:06am
View
in row command i successfully save bit1 for chek and bit0 for uncheck in a table.. but how to get this saved state in my gridview..plzzz tell me
Rashid Choudhary
28-Sep-12 1:06am
View
in row command i successfully save bit1 for chek and bit0 for uncheck in a table.. but how to get this saved state in my gridview..plzzz tell me
Rashid Choudhary
28-Sep-12 1:05am
View
in row command i successfully save bit1 for chek and bit0 for uncheck in a table.. but how to get this saved state in my gridview..plzzz tell me
Rashid Choudhary
27-Sep-12 8:31am
View
plz send me a code which is used in row command
Rashid Choudhary
27-Sep-12 8:19am
View
plzzz solved it in ur way...
Rashid Choudhary
27-Sep-12 8:18am
View
on grid1_rowdatabound
Rashid Choudhary
27-Sep-12 8:17am
View
Deleted
on grid1_databound
Rashid Choudhary
27-Sep-12 8:10am
View
here is my source code
<asp:GridView ID="Grid1" runat="server" BackColor="#DEBA84"
BorderColor="#DEBA84" BorderStyle="None" BorderWidth="1px" CellPadding="3"
CellSpacing="2" Width="90%" Height="10%"
AutoGenerateColumns="False"
AllowPaging="True" AllowSorting="True" PageSize="5"
onpageindexchanging="Grid1_PageIndexChanging"
onrowediting="Grid1_RowEditing" onrowupdating="Grid1_RowUpdating"
DataKeyNames ="P_id, U_id" >
<rowstyle backcolor="#FFF7E7" forecolor="#8C4510">
<footerstyle backcolor="#F7DFB5" forecolor="#8C4510">
<PagerStyle ForeColor="#8C4510" HorizontalAlign="Center" />
<SelectedRowStyle BackColor="#738A9C" Font-Bold="True" ForeColor="White" />
<HeaderStyle BackColor="#A55129" Font-Bold="True" ForeColor="White" />
<columns>
<asp:TemplateField HeaderText="Productname">
<itemtemplate>
<asp:Label ID="lblprodn" runat="server" Text ='<%#bind("Product_name") %>'>
<asp:TemplateField HeaderText="ProductQuantity">
<itemtemplate>
<asp:Label ID="lblprodq" runat="server" Text ='<%#bind("Product_quan") %>'>
<asp:TemplateField HeaderText="ProductDeliveredOn">
<itemtemplate>
<asp:Label ID="lbldate" runat="server" Text ='<%#bind("Delivery_date") %>'>
<asp:TemplateField HeaderText="Product Ready">
<itemtemplate>
<asp:CheckBox ID="checkbox1" runat="server" Checked="false"/>
<%-- <asp:Button ID="Button2" runat="server" Text="ProductReady" CommandName="Update" onclick="Button2_Click" CausesValidation="False"
OnClientClick="return confirm('information send to management for confirmation');"/>--%>
<asp:TemplateField HeaderText="Date Extend" >
<itemtemplate>
<asp:Label ID ="lbl1" runat="server" Text='<%#Bind("Extend_date") %>'>
<edititemtemplate>
<asp:TextBox ID="txtlbl" runat="server" class= "datepicker" Text='<%# Bind("Extend_date")%>'>
<asp:TemplateField HeaderText="Operation">
<itemtemplate>
<asp:Button ID="btnedit" runat="server" CommandName="Edit" Text="Edit" />
<edititemtemplate>
<asp:Button ID="btnupdate" runat="server" CommandName="Update" Text="Update" />
<rowstyle backcolor="#FFF7E7" forecolor="#8C4510">
<footerstyle backcolor="#F7DFB5" forecolor="#8C4510">
<PagerStyle ForeColor="#8C4510" HorizontalAlign="Center" />
<SelectedRowStyle BackColor="#738A9C" Font-Bold="True" ForeColor="White" />
<HeaderStyle BackColor="#A55129" Font-Bold="True" ForeColor="White" />
Rashid Choudhary
27-Sep-12 8:08am
View
whose event will be use i m?
Rashid Choudhary
27-Sep-12 3:12am
View
state is saved
Rashid Choudhary
27-Sep-12 2:53am
View
when i reload the page or reopen the page the checkbox is show already checked
Rashid Choudhary
27-Sep-12 2:52am
View
it does'nt matter page reload
Rashid Choudhary
27-Sep-12 2:52am
View
when i click any checkbox..then this checkbox is shows checked
Rashid Choudhary
24-Sep-12 2:23am
View
text
Rashid Choudhary
24-Sep-12 1:25am
View
i have already a chart..but i dont know how to bind data from database..
Rashid Choudhary
18-Sep-12 3:03am
View
thanxxx mam
Rashid Choudhary
18-Sep-12 3:02am
View
Deleted
thanxxxx sir
Rashid Choudhary
18-Sep-12 2:52am
View
can i write Uname and Delivery_date in place of @ddlValue = 1 and @ddlValue = 2
Rashid Choudhary
17-Sep-12 1:17am
View
i hv drpdwnlst.in lst two or more colum is placed..when i select any column name then the related data is shown in grid view..
Rashid Choudhary
14-Sep-12 2:26am
View
i already use but the Fname is repeated
Rashid Choudhary
14-Sep-12 2:22am
View
i hv a table in which the first nd last name is repeated. i want get all data but not repeated in first nd last name
Rashid Choudhary
14-Sep-12 2:17am
View
but data is not repeated
Rashid Choudhary
14-Sep-12 2:16am
View
i want all information of fname and lname
Rashid Choudhary
10-Sep-12 7:02am
View
okkkkkkkkk
Rashid Choudhary
10-Sep-12 4:58am
View
thanxxx sir
Rashid Choudhary
31-Aug-12 1:17am
View
and then
Show More