This is a migrated thread and some comments may be shown as answers.

hierarchy RadGrid

3 Answers 54 Views
Grid
This is a migrated thread and some comments may be shown as answers.
ghadeer
Top achievements
Rank 1
ghadeer asked on 19 Nov 2008, 10:58 AM
Hi All,

how can I hide the DetailTables for some rows(not for all rows) in the MasterTableView depend on condition at runtime??????

Please  help me ASAP

thnks in advance
ghadeer

3 Answers, 1 is accepted

Sort by
0
Daniel
Telerik team
answered on 19 Nov 2008, 11:52 AM
Hello Ghadeer,

I suggest you examine the following thread:
Hide detail tables

Regards,
Daniel
the Telerik team

Check out Telerik Trainer, the state of the art learning tool for Telerik products.
0
ghadeer
Top achievements
Rank 1
answered on 20 Nov 2008, 08:54 AM

hello there
please I used before detaildatabind event its ok but it didnt hide the detailtable for some record , I get that thread but I couldnt to apply my code to prerender event could you help me.

my code inside detaildatabind  event like:
string

iCertificate = string.Empty;

 

 

string[] iTypes ={ };

 

 

try

 

{

 

GridDataItem _dataItem = (GridDataItem)e.DetailTableView.ParentItem;

 

 

int _iRequestId = Convert.ToInt32(_dataItem["SRID"].Text);

 

 

switch (e.DetailTableView.Name)

 

{

 

case "TravelPermitDetails":

 

iCertificate = (_dataItem.FindControl(

"lblCertificate") as Label).Text;// to check if the request for travel permit.

 

iTypes = iCertificate.Split(

',');

 

 

foreach (string iType in iTypes)

 

{

 

if (iType.ToLower() == "Travel Permit".ToLower())

 

{

e.DetailTableView.DataSource = _Controller.TravelDetails(_iRequestId);

}

 

//else

 

 

// e.DetailTableView.Visible=false

 

}

 

break;

 

}

}

 

catch (Exception)

 

{

 

throw;

 

}

0
Daniel
Telerik team
answered on 24 Nov 2008, 11:21 AM
Hello Ghadeer,

You can find an example code-snippet below:
void radGrid1_DetailTableDataBind(object source, GridDetailTableDataBindEventArgs e) 
    if ((int)e.DetailTableView.ParentItem.GetDataKeyValue("CategoryID") == 1) 
    { 
        e.DetailTableView.ParentItem.Expanded = false
        return
    } 
... 

Let me know if you need further assistance.

Regards,
Daniel
the Telerik team

Check out Telerik Trainer, the state of the art learning tool for Telerik products.
Tags
Grid
Asked by
ghadeer
Top achievements
Rank 1
Answers by
Daniel
Telerik team
ghadeer
Top achievements
Rank 1
Share this question
or