c# - How to Disable Grid View Row After File Upload Control Completes File Uploading Operation -
c# - How to Disable Grid View Row After File Upload Control Completes File Uploading Operation -
i have grid view in there 3 fields. first info bound field, sec template field contains text box command , 3rd 1 time again template field contains fileupload control.
i want disable grid view row when file upload command completes file upload operation.
my code grid binding :
using system; using system.collections.generic; using system.linq; using system.web; using system.web.ui; using system.web.ui.webcontrols; using system.data; using system.data.sqlclient; public partial class gr4 : system.web.ui.page { sqlconnection cn; sqlcommand cmd; sqldataadapter da; dataset ds; protected void page_load(object sender, eventargs e) { cn = new sqlconnection("data source=amir-pc\\mohemmad;initial catalog=crm_investplus;integrated security=true"); string query = "select capacity dealer_license_capacity id='d00001' , software_id='001' , version_id='1'"; cn.open(); cmd = new sqlcommand(query,cn); da = new sqldataadapter(cmd); ds = new dataset(); da.fill(ds); cn.close(); string query1 = "select cost version_master software_id='001' , version_id='1'"; cn.open(); cmd = new sqlcommand(query1, cn); da = new sqldataadapter(cmd); dataset ds1 = new dataset(); da.fill(ds1); cn.close(); string query2 = "select software_name software_master software_id='001'"; cn.open(); cmd = new sqlcommand(query2, cn); da = new sqldataadapter(cmd); dataset ds2 = new dataset(); da.fill(ds2); cn.close(); datatable dt = new datatable(); // dt.columns.add("name", typeof(string)); dt.columns.add("software_name", typeof(string)); dt.columns.add("price", typeof(string)); int count = convert.toint32(ds.tables[0].rows[0][0].tostring()); (int = 0; < count; i++) { datarow dr = dt.newrow(); // dr["name"] = "aaa"; dr["software_name"] = ds2.tables[0].rows[0][0].tostring(); dr["price"] = ds1.tables[0].rows[0][0].tostring(); dt.rows.add(dr); if (i == 0) response.write(dr["price"]); } gridview1.datasource = dt; gridview1.databind(); //gridview1.selectedrow.enabled = false; } }
and source file of grid :
<asp:gridview id="gridview1" runat="server" autogeneratecolumns="false"> <columns> <asp:boundfield datafield="software_name" /> <asp:templatefield> <edititemtemplate> <asp:textbox id="textbox1" runat="server" ></asp:textbox> </edititemtemplate> <itemtemplate> <asp:textbox id="textbox2" runat="server" text='<%# eval("price") %>'></asp:textbox> </itemtemplate> </asp:templatefield> <asp:templatefield> <itemtemplate> <asp:fileupload id="fileupload1" runat="server" /> </itemtemplate> </asp:templatefield> </columns> </asp:gridview>
data bounded want disable selected row of gridview after file upload command completes operation.
please help
thanks in advance.
protected void gridview1_databound(object sender, gridviewroweventargs e) { if (e.row.rowtype == datacontrolrowtype.datarow) { e.row.enabled=false;//check on status uploaded completed } }
c# asp.net visual-studio-2010
Comments
Post a Comment