// DropDown Generator private void GenerateRole() { TxtRoleName.Items.Clear(); var ret = roleControl.GetData(); var datas = ret.Result; if (datas != null && datas.Count() > 0) { TxtRoleName.DataSource = datas; TxtRoleName.DataTextField = "roleName"; TxtRoleName.DataValueField = "roleName"; TxtRoleName.DataBind(); } TxtRoleName.SelectedIndex = 0; }
// Reload datagrid void RefreshGrid(string param = "") { GvData.DataBind(); if (param == null || param == "") { var ret = roleControl.GetData(); var datas = ret.Result; if (datas != null && datas.Count() > 0) { GvData.DataSource = datas; GvData.DataBind(); } } else { var ret = roleControl.GetDataByContaint(param); var datas = ret.Result; if (datas != null && datas.Count() > 0) { GvData.DataSource = datas; GvData.DataBind(); } } //if (GvData.Rows.Count > 0) //{ // //This replaces <td> with <th> // GvData.UseAccessibleHeader = true; // //This will add the <thead> and <tbody> elements // GvData.HeaderRow.TableSection = TableRowSection.TableHeader; // //This adds the <tfoot> element. Remove if you don't have a footer row // GvData.FooterRow.TableSection = TableRowSection.TableFooter; //} }