gridview InsertItemTemplate DefaultValue doesn't get set.

P

paulhux174

I have an inner and outter grids, I'm setting the inner Grid's
SqlDataSource SelectParameters depending on the outter Grids data -
This works.

when I call insert (using all default Grid functionality - no code)
using the 'insert' button the Grid creates,
the insert default parameter is lost (or over written). I'm not showing
the parameter ( or bound column) in the Grid's InsertItemTemplate .





protected void GV_OnRowDataBound(object sender, GridViewRowEventArgs
e)
{
if (e.Row.RowType == DataControlRowType.DataRow)
{
SqlDataSource s =
(SqlDataSource)e.Row.FindControl("SqlDataSource2");
s.SelectParameters[0].DefaultValue = e.Row.Cells[0].Text;
s.InsertParameters[0].DefaultValue = e.Row.Cells[0].Text;
// ****** store the default value now seams to work

}
}
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,764
Messages
2,569,564
Members
45,039
Latest member
CasimiraVa

Latest Threads

Top