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

[Solved] GridView Rows Finding Issues in Master Table

1 Answer 146 Views
Grid
This is a migrated thread and some comments may be shown as answers.
nitin
Top achievements
Rank 1
nitin asked on 16 Jul 2009, 04:41 AM
Hi all,

I am stuck with an issue from a couple of days. any help will be highly appreciated. I am using Telerik 2009 Ajax Version and facing 2 issues with that. let me explain One by One

1) my first problem is that i am binding  the Radgrid with a direct datasource and have not taken any databound column. in that Grid i have a sub grid(Group panel) and a further group panel. let me make it more clear. I am binding a grid that have Call Details like(Select * from Call Table) and putting this in a Dataset and passed that dataset to the Radgrid. In that Grid if a user clicks on a particular call the   corresponding tasks are binded and that is done with the same databinding. and on selecting the task, the actions will be shown in the task. I am Binding the Call Grid and the task Grid on the page load only and i have taken Bound Columns for Task Grid.. this can be made clear from the following HTML:

 <telerik:RadGrid ID="GrdAddSerach" runat="server" AllowPaging="True" Font-Names="Verdana"
EnableEmbeddedSkins="false" BorderColor="Silver" BorderStyle="None" Skin=""
BorderWidth="1px" GridLines="Both" EnableTheming="true"
AllowSorting="True" PageSize="14" AllowFilteringByColumn="true" AutoGenerateColumns="false"
GroupPanel-Height="20px" GroupPanel-Font-Bold="false" Width="100%"
ShowGroupPanel="True">

<MasterTableView DataKeyNames="CALLNO,COMPID" HierarchyLoadMode="Client">
<telerik:GridTableView DataMember="Tasks" DataKeyNames="TM_NU9_Call_No_FK,TM_NU9_Comp_ID_FK,TM_NU9_Task_no_PK"
                                                                                NoDetailRecordsText="No Tasks available for this call" ShowHeadersWhenNoRecords="false" AllowFilteringByColumn="false" AutoGenerateColumns="false" HierarchyLoadMode="ServerOnDemand" AllowPaging="true" PageSize="10" CellPadding="0" CellSpacing="0" BorderStyle="Solid" BorderWidth="1" BorderColor="#8FADD5">


  <DetailTables>
                                                                                    <telerik:GridTableView DataMember="TaskActions" DataKeyNames="AM_NU9_Comp_ID_FK,AM_NU9_Call_Number,AM_NU9_Task_Number,AM_NU9_Action_Number"
                                                                                       AutoGenerateColumns="false" AllowFilteringByColumn="false" ShowHeadersWhenNoRecords="false"
                                                                                        NoDetailRecordsText="No Actions available for this Task" AllowPaging="true" PageSize="10" BorderWidth="1" BorderColor="#8FADD5">
                                                                                        <CommandItemSettings AddNewRecordImageUrl="AddRecord.gif"
                                                                                            RefreshImageUrl="Refresh.gif" />
                                                                                        <Columns>
                                                                                            <telerik:GridBoundColumn DataField="AM_NU9_Action_Number" DataType="System.Int32"
                                                                                                HeaderText="Action No" ReadOnly="True" SortExpression="AM_NU9_Action_Number"
                                                                                                UniqueName="AM_NU9_Action_Number" FilterListOptions="VaryByDataType" AutoPostBackOnFilter="true"
                                                                                                CurrentFilterFunction="EqualTo">
                                                                                            </telerik:GridBoundColumn>
                                                                                            <telerik:GridBoundColumn DataField="AM_VC_2000_Description" DataType="System.String"
                                                                                                HeaderText="Description" ReadOnly="True" SortExpression="AM_VC_2000_Description"
                                                                                                UniqueName="AM_VC_2000_Description" AllowFiltering="true" CurrentFilterFunction="Contains" ItemStyle-Width="150">
                                                                                                <ItemStyle Width="150px" />
                                                                                            </telerik:GridBoundColumn>
                                                                                            <telerik:GridBoundColumn DataField="UM_VC50_UserID" DataType="System.Int32" HeaderText="ActionOwner"
                                                                                                ReadOnly="True" SortExpression="UM_VC50_UserID" UniqueName="UM_VC50_UserID" AutoPostBackOnFilter="true"
                                                                                                CurrentFilterFunction="Contains">
                                                                                            </telerik:GridBoundColumn>
                                                                                            <telerik:GridBoundColumn DataField="AM_DT8_Action_Date" DataType="System.DateTime"
                                                                                                HeaderText="Action Date" ReadOnly="True" SortExpression="AM_DT8_Action_Date"
                                                                                                UniqueName="AM_DT8_Action_Date">
                                                                                            </telerik:GridBoundColumn>
                                                                                            <telerik:GridBoundColumn DataField="AM_FL8_Used_Hr" DataType="System.DateTime" HeaderText="Action hrs"
                                                                                                ReadOnly="True" SortExpression="AM_FL8_Used_Hr" UniqueName="AM_FL8_Used_Hr">
                                                                                            </telerik:GridBoundColumn>
                                                                                        </Columns>
                                                                                        <EditFormSettings>
                                                                                            <PopUpSettings ScrollBars="None"></PopUpSettings>
                                                                                            <%--<EditColumn CancelImageUrl="Cancel.gif" EditImageUrl="Edit.gif"
                                                                                                InsertImageUrl="Update.gif" UpdateImageUrl="Update.gif">
                                                                                            </EditColumn>--%><EditColumn CancelImageUrl="Cancel.gif"
                                                                                                EditImageUrl="Edit.gif" FilterImageUrl="Filter.gif" InsertImageUrl="Update.gif"
                                                                                                SortAscImageUrl="SortAsc.gif" SortDescImageUrl="SortDesc.gif"
                                                                                                UpdateImageUrl="Update.gif">
                                                                                            </EditColumn>
                                                                                        </EditFormSettings>
                                                                                        <%--<PagerStyle FirstPageImageUrl="PagingFirst.gif"
                                                                                            LastPageImageUrl="PagingLast.gif" NextPageImageUrl="PagingNext.gif"
                                                                                            PrevPageImageUrl="PagingPrev.gif" />--%>
                                                                                    </telerik:GridTableView>
                                                                                </DetailTables>
                                                                                <Columns>
                                                                                    <telerik:GridBoundColumn DataField="TM_NU9_Call_No_FK" DataType="System.Int32" HeaderText="Call No"
                                                                                        Visible="false" ReadOnly="True" SortExpression="TM_NU9_Call_No_FK" UniqueName="TM_NU9_Call_No_FK"
                                                                                        AutoPostBackOnFilter="true" CurrentFilterFunction="EqualTo"
                                                                                        FilterListOptions="VaryByDataType" >
                                                                                    </telerik:GridBoundColumn>
                                                                                    <telerik:GridBoundColumn DataField="TM_NU9_Comp_ID_FK" DataType="System.Decimal"
                                                                                        HeaderText="Comp Id" ReadOnly="True" SortExpression="TM_NU9_Comp_ID_FK" UniqueName="TM_NU9_Comp_ID_FK"
                                                                                        Visible="false" FilterListOptions="VaryByDataType">
                                                                                    </telerik:GridBoundColumn>
                                                                                    <telerik:GridBoundColumn DataField="TM_NU9_Task_no_PK" DataType="System.String" HeaderText="TaskNo"
                                                                                        ReadOnly="True" SortExpression="TM_NU9_Task_no_PK" UniqueName="TM_NU9_Task_no_PK"
                                                                                        AutoPostBackOnFilter="true" CurrentFilterFunction="EqualTo" FilterListOptions="VaryByDataType" ItemStyle-Width="20px">
                                                                                        <ItemStyle Width="20px" />
                                                                                    </telerik:GridBoundColumn>
                                                                                   
                                                                                    <telerik:GridBoundColumn DataField="UM_VC50_UserID" DataType="System.Int32" HeaderText="TaskOwner"
                                                                                        ReadOnly="True" SortExpression="UM_VC50_UserID" UniqueName="UM_VC50_UserID" AutoPostBackOnFilter="true"
                                                                                        CurrentFilterFunction="Contains" FilterListOptions="VaryByDataType" ItemStyle-Width="70">
                                                                                        <ItemStyle Width="70px" />
                                                                                    </telerik:GridBoundColumn>
                                                                                    <telerik:GridBoundColumn DataField="TM_VC50_Deve_status" DataType="System.Int32"
                                                                                        HeaderText="TaskStatus" ReadOnly="True" SortExpression="TM_VC50_Deve_status"
                                                                                        UniqueName="TM_VC50_Deve_status" ItemStyle-Wrap="true" FilterListOptions="VaryByDataType"  ItemStyle-Width="60">
                                                                                        <ItemStyle Width="60px" Wrap="True" />
                                                                                    </telerik:GridBoundColumn>
                                                                                    <telerik:GridBoundColumn DataField="TM_VC1000_Subtsk_Desc" DataType="System.Int32"
                                                                                        HeaderText="TaskDesc" ReadOnly="True" SortExpression="TM_VC1000_Subtsk_Desc"
                                                                                        UniqueName="TM_VC1000_Subtsk_Desc" FilterListOptions="VaryByDataType" CurrentFilterFunction="Contains"  ItemStyle-Width="190">
                                                                                        <ItemStyle Width="190px" />
                                                                                    </telerik:GridBoundColumn>
                                                                                    <telerik:GridBoundColumn DataField="TM_VC8_task_type" DataType="System.Int32" HeaderText="TType"
                                                                                        ReadOnly="True" SortExpression="TM_VC8_task_type" UniqueName="TM_VC8_task_type"  ItemStyle-Width="60">
                                                                                        <ItemStyle Width="60px" />
                                                                                    </telerik:GridBoundColumn>
                                                                                     <telerik:GridBoundColumn DataField="EST_HOURS" DataType="System.Int32" HeaderText="EST_HOURS"
                                                                                        ReadOnly="True" SortExpression="EST_HOURS" UniqueName="EST_HOURS"  ItemStyle-Width="60">
                                                                                         <ItemStyle Width="60px" />
                                                                                    </telerik:GridBoundColumn>
                                                                                     <telerik:GridBoundColumn DataField="ACTUAL_HOURS" DataType="System.Int32" HeaderText="ACTUAL_HOURS"
                                                                                        ReadOnly="True" SortExpression="ACTUAL_HOURS" UniqueName="ACTUAL_HOURS"  ItemStyle-Width="60">
                                                                                         <ItemStyle Width="60px" />
                                                                                    </telerik:GridBoundColumn>
                                                                                     <telerik:GridBoundColumn DataField="EST_CLOSE_DATE" DataType="System.DateTime" HeaderText="EST CLOSE DATE"
                                                                                        ReadOnly="True" SortExpression="EST_CLOSE_DATE" UniqueName="EST_CLOSE_DATE"  ItemStyle-Width="75">
                                                                                         <ItemStyle Width="75px" />
                                                                                    </telerik:GridBoundColumn>
                                                                                     <telerik:GridBoundColumn DataField="ACT_CLOSE_DATE" DataType="System.DateTime" HeaderText="ACT CLOSE DATE"
                                                                                        ReadOnly="True" SortExpression="ACT_CLOSE_DATE" UniqueName="ACT_CLOSE_DATE"  ItemStyle-Width="75">
                                                                                         <ItemStyle Width="75px" />
                                                                                    </telerik:GridBoundColumn>
                                                                                     <telerik:GridBoundColumn DataField="CALCULATE_HOURS" DataType="System.Int32" HeaderText="% HOURS Completed"
                                                                                        ReadOnly="True" SortExpression="CALCULATE_HOURS" UniqueName="CALCULATE_HOURS"  ItemStyle-Width="60">
                                                                                         <ItemStyle Width="60px" />
                                                                                    </telerik:GridBoundColumn>
                                                                                </Columns>
                                                                                <CommandItemSettings AddNewRecordImageUrl="AddRecord.gif"
                                                                                    RefreshImageUrl="Refresh.gif" />
                                                                                <ExpandCollapseColumn Visible="true" Resizable="False">
                                                                                    <HeaderStyle Width="20px"></HeaderStyle>
                                                                                </ExpandCollapseColumn>
                                                                                <EditFormSettings>
                                                                                    <PopUpSettings ScrollBars="None"></PopUpSettings>
                                                                                   <%-- <EditColumn CancelImageUrl="Cancel.gif" EditImageUrl="Edit.gif"
                                                                                        InsertImageUrl="Update.gif" UpdateImageUrl="Update.gif">
                                                                                    </EditColumn>--%><EditColumn CancelImageUrl="Cancel.gif"
                                                                                        EditImageUrl="Edit.gif" FilterImageUrl="Filter.gif" InsertImageUrl="Update.gif"
                                                                                        SortAscImageUrl="SortAsc.gif" SortDescImageUrl="SortDesc.gif"
                                                                                        UpdateImageUrl="Update.gif">
                                                                                    </EditColumn>
                                                                                </EditFormSettings>
                                                                               <%-- <PagerStyle FirstPageImageUrl="PagingFirst.gif"
                                                                                    LastPageImageUrl="PagingLast.gif" NextPageImageUrl="PagingNext.gif"
                                                                                    PrevPageImageUrl="PagingPrev.gif" />--%>
                                                                            </telerik:GridTableView>
                                                                        </DetailTables>
                                                                        <Columns>

 </MasterTableView>
</telerik:RadGrid>
 
The problem is i want to find the Rows of the task Grid table and want to change the rows color on specific conditions,how can i find it. i am not getting the row count. Please help me...



2) I dont want the filter Icon with the Filter Buttons, i have made the allowfilteringby column as true but the issue is i am binding the grid with dataset Directly not with Databound Columns therefore i am not able to add condition "ShowFilteringColumn" as False.. Please help me Regarding this issue also.. I will be really thankful to you..

THere is one more issue. i am not using any skin file and taking skin="" but in the filterMenu i am using the skins and i have made the necessary conditions to true but now the skin is not being loaded. Please Help me in either way ie either hiding the filter button or showing the skin with filter menu

1 Answer, 1 is accepted

Sort by
0
Pavlina
Telerik team
answered on 21 Jul 2009, 06:30 PM
Hello,

The GridTableView object has an Items property that contains all the data rows in the table view. Each row is represented by a GridDataItem object. The GridDataItem has an ItemIndex property that is its index in the Items property collection.
For more information about how to find the desired rows and change the color on specific conditions, please refer to this help articles:
Accessing cells and rows
Conditional Formatting for rows/cells on ItemDataBound

About your second question if I understand you correctly, you have filtering enabled and the filter row is visible, but don't want the filter icons in each table cell. If this is the case, please add the following CSS rule to your web application:

CSS:

.RadGrid .rgFilter  
{  
     displaynone;  

Kind regards,

Pavlina
the Telerik team

 


Instantly find answers to your questions on the new Telerik Support Portal.
Check out the tips for optimizing your support resource searches.
Tags
Grid
Asked by
nitin
Top achievements
Rank 1
Answers by
Pavlina
Telerik team
Share this question
or