In the code behind, You can call
gridView1. DataSource = SQlDataSource1;
gridView.DataBind();
You should do the databind for any and all gridview related events you are
raising, like
Selecting, Updating, deleting, Paging etc..
And, initial databind could be in PageLoad, like
if(!Page.IsPostback)
{
gridView1. DataSource = SQlDataSource1;
gridView.DataBind();
}
you could also provide any DataSource related parameters in code behind
similar to..
SqlDataSource1.SelectCommand = "Select * from employees where employee
id=@id";
Parameter selectParam = new Parameter();
selectParam.DbType = DbType.Integer;
selectParam.DefaultValue = "100"; // Employee id...
SqlDataSource1.SelectParameters.Add(selectParam.)
Thank You,
Nanda Lella,
This Posting is provided "AS IS" with no warranties, and confers no rights.