Adding Column to GridView data source and bind data to it at run time, C# -


i working on task requires binding data gridview has 7 columns. 6 columns of gridview binded dataset database sql command... need bind last column dynamically @ run time data comes file @ run time. there mechanism add 7th column datasource @ run time , bind it's value? . .

 e.row.cells(7).text = f.name.tolower.replace(cstr(databinder.eval(e.row.dataitem, "licensename")).tolower, "").replace(".7z", "").trim 

. . how got value

you need template column, :

<columns>     ...      ...      <asp:templatefield>         <itemtemplate>             <asp:label id="lblseventhcol" runat="server"                  ondatabinding="lblseventhcol_databinding"></asp:label>         </itemtemplate>     </asp:templatefield> </columns> 

and

protected void lblseventhcol_databinding(object sender, eventargs e) {     (sender label).text = getdynamicdata(); } 

Comments

Popular posts from this blog

apache - Add omitted ? to URLs -

redirect - bbPress Forum - rewrite to wwww.mysite prohibits login -

php - How can I stop spam on my custom forum/blog? -