c# - Changing access modifier of CreateRow method of GridView -


is possible change access modifier in c# asp.net dll file.

for example, trying use createrow of gridview in c# asp.net , error

"system.web.ui.webcontrols.gridview.createrow(int, int, system.web.ui.webcontrols.datacontrolrowtype, system.web.ui.webcontrols.datacontrolrowstate) inaccessible due protection level"

i checked modifier , protected. when tried change, says readonly , cannot changed. possible?

update: trying dataset database , trying bind gridview. dataset might have upto 4 rows. if has rows less 4 remaining rows should shown empty in gridview. trying create 4 empty rows using createrow method , binding each row dataset. hope clear!

thank in advance!!

i'm not going anwer original question asked ("is possible change access modifier in c# asp.net dll file"), root of question (adding empty rows gridview).

i think better approach (rather trying call createrow on gridview) add empty rows dataset, , bind gridview. different based on specific data type storing data in, basic steps be:

  1. get data database
  2. use logic check how many rows there are
  3. if there less 4 items, add additionaly (empty) items / rows collection data stored step 1.
  4. set gridview.datasource data collection
  5. call gridview.databind();

to elaborate on step #3, this:

// dataset database dataset data = getmydatasomehow(); // create blank row object[] newrow = new object[3]; // "3" number of columns in table newrow[0] = ""; newrow[1] = ""; newrow[2] = ""; //add blank row data.tables["mytable"].beginloaddata(); data.tables["mytable"].loaddatarow(newrow, true); data.tables["mytable"].endloaddata(); 

Comments

Popular posts from this blog

linux - xterm copying to CLIPBOARD using copy-selection causes automatic updating of CLIPBOARD upon mouse selection -

c++ - qgraphicsview horizontal scrolling always has a vertical delta -