Your Privacy Matters: We use our own and third-party cookies to improve your experience on our website. By continuing to use the website we understand that you accept their use. Cookie Policy
745
how to bind Bind Dataset to the WebGrid which having Relation..Urgent
posted

Hi,

i just want to bind a dataset which having the relation..here am giving my code,i am using infra2009.3,but i did' nt get the result

GlobalDs.Relations.Add(

"CSV_SKU", GlobalDs.Tables["csvData"].Columns["SrNo"], GlobalDs.Tables["skuno"].Columns["SrNo"]);

 

this.UltraWebGrid1.DataSource = GlobalDs;

 

this.UltraWebGrid1.DataKeyField = "SrNo";

 

this.UltraWebGrid1.DataBind();

Regards

Naag

Parents
No Data
Reply
  • 265
    posted

    Hi,

    I think you need to create the relation first, like this:

    DataRelation relation = new DataRelation("SrNoRelation", dataset.Tables["csvData"].Columns["SrNo"], dataset.Tables["skuno"].Columns["SrNo"]);
      GlobalDs.Relations.Add(relation);
      UltraWebGrid1.DataSource = GlobalDs;
    UltraWebGrid1.DataBind();

     

Children
No Data