GridView頁尾應用

2021-04-13 08:26:43 字數 2776 閱讀 4020

前台:

<%@ page language="c#" autoeventwireup="true" codefile="setgradeitemsrules.aspx.cs" inherits="yjp_setvoterules" enableeventvalidation="false"%>

後台:using system;

using system.data;

using system.configuration;

using system.collections;

using system.web;

using system.web.security;

using system.web.ui;

using system.web.ui.webcontrols;

using system.web.ui.webcontrols.webparts;

using system.web.ui.htmlcontrols;

using system.data.sqlclient;

public partial class yjp_setvoterules : system.web.ui.page

}private void ddl_gradedtype_databound()

public void gv_gradeitem_databound()

gv_gradeitem.datasource = table;

gv_gradeitem.databind();

}protected void gv_gradeitem_rowdatabound(object sender, gridviewroweventargs e)}}

}if (e.row.cells[0].controls[1] is label)

else}}

}protected void button1_click1(object sender, eventargs e)

con.close();

}protected void gv_gradeitem_rowcommand1(object sender, gridviewcommandeventargs e)

if (e.commandname == "n_update")

if (e.commandname == "n_cancel")

if (e.commandname == "graderule")

if(e.commandname == "del")}}

else}}

}public bool i***istgraderules(string gradeditemid)

else

}public bool deletegradeitem(string gradeitemid)

else

}public bool deletgraderules(string graderuleid,int sign)

else if (sign == 2)

sqlconnection con = new sqlconnection(commonclass.connectionstring);

sqlcommand com = new sqlcommand(deletestring, con);

con.open();

if (com.executenonquery() > 0)

else

}public void gv_graderules_databind()

else

aheaddatasource.iaheaddatalinker linker = commonclass.getdatalinker();

system.data.datatable table = linker.getdataformstring(selectstring);

if (table.rows.count == 0)

gv_graderules.datasource = table;

gv_graderules.databind();

}protected void updategradeitem(string name,string point,string typeid,string gradeitemid)

protected void gv_gradeitem_pageindexchanging(object sender, gridviewpageeventargs e)

protected void gv_graderules_rowcommand(object sender, gridviewcommandeventargs e)

if (e.commandname == "n_update")

if (e.commandname == "n_cancel")

if (e.commandname == "graderule")

if (e.commandname == "del")}}

protected void updategraderules(string gradeditemid,string gradeditemexplain,string point,string graderuleid )

protected void btn_addgraderules(object sender, eventargs e)

con.close();

}protected void gv_graderules_rowdatabound(object sender, gridviewroweventargs e)

else}}

}}

GridView小應用隨記(1)

獲取某行中某單元格資料的方法 string emp textbox gridview1.rows e.rowindex cells 2 controls 0 text.tostring trim 獲取頁尾模板中控制項資料的方法 textbox emprealname gridview1.footer...

GridView高階應用問題,請教

public pageno as new dropdownlist protected sub gviewemployees databound byval sender as object,byval e as system.eventargs dim bottonpagerrow as grid...

pdf頁首頁尾

public class itextlist catch ioexception e font chinese new font fontchinese,10,font.normal headerfooter的第2個引數為非false時代表列印頁碼 頁首頁尾中也可以加入,並非只能是文字 header...