Telerik Forums
UI for ASP.NET AJAX Forum
1 answer
486 views
hi,

I am using a radtooltip to make a dynamic tutorial.

To be able to move the tutorial around I had to put it as relative to the BrowserWindow.
Then I can change the offsets.

The reason I am doing this is because I cannot attach the tutorial to anything because I am using a canvas to draw things.
And the tutorial is pointing to those drawings on the canva.
If I attach the tutorial to the canvas, it will just display on the side of the canvas, no near the controls.

My problem with this is that I lose the small arrow on the side of the tutorial window.
And I would like to have it back.

Am I doing things right and there is no way to get the small arrow to show?
Or is there an other way to do what I want that would restore the arrow ?

This is my code for the tooltip:

<telerik:RadToolTip
    runat="server"
    ID="RadToolTip3"
    Position="Center"
    Width="300px"
    Height="70px"
    Animation="Fade"
    ShowEvent="FromCode"
    HideEvent="FromCode"
    ShowDelay="0"
    RelativeTo="BrowserWindow"
    OnClientBeforeShow="PreTooltipShow"
    OffsetX="0"
    OffsetY="0">
    <div style="display: table;">
        <div style="display: table-row;">
            <div style="display: table-cell; vertical-align: middle; padding-top: 10px; padding-left: 10px; padding-bottom: 5px; padding-right: 10px;">
                <asp:Label ID="Lbl_Tutorial" runat="server" Text="This is a test" />
            </div>
        </div>
        <div style="display: table-row;">
            <div style="display: table-cell; vertical-align: middle; text-align:right; padding-top: 10px; padding-left: 10px; padding-bottom: 5px; padding-right: 10px;">
                <telerik:RadButton
                    ID="RdBttn_NextTutorial"
                    runat="server"
                    Text="Next"
                    AutoPostBack="false"
                    OnClientClicked="OnNextTutorial">
                </telerik:RadButton>
            </div>
        </div>
    </div>
</telerik:RadToolTip>

With the following javascript to control it:

function PreTooltipShow() {
    PageMethods.PreTooltipShow(PreTooltipShowCompleted);
}
 
function PreTooltipShowCompleted(pResult) {
    var tooltip = $find('RadToolTip3');
    if (pResult.length > 0) {
  
        tooltip.set_offsetX(parseInt(pResult[0]));
        tooltip.set_offsetY(parseInt(pResult[1]));
        tooltip.updateLocation();
 
        var label = document.getElementById('<%=Lbl_Tutorial.ClientID %>');
        label.innerHTML = pResult[2];
 
        var button = $find('RdBttn_NextTutorial');
        button.set_text(pResult[3]);
    }
    else {
        tooltip.hide();
    }
}
 
function OnNextTutorial() {
    var button = $find('RdBttn_NextTutorial');
    PageMethods.OnNextTutorial(PreTooltipShowCompleted);
}




Marin Bratanov
Telerik team
 answered on 05 Nov 2014
1 answer
120 views
Looks like if I want to export to excel I first need to bind radgrid and load to  the page and then the user does something to initiate the download.

I am trying to do the bind and export in one event. Thats why I didn't add my grid to the page, I just wanted to leverage its ability to export the data for me. I don't plan on my user ever seeing a bound radgrid.

Is something like this possible? 
public void RunReport_Click(object sender, EventArgs e)
{
    //bind a radgrid in code behind
    //export the radgrid to excel when its done binding
}

Please advise.

My data has dynamic column. I use dynamic query. The code I'm using is
       private void BuildReport(string @SpecID)
        {
            RadGrid gvTemp = new RadGrid();
            
            int db = (int)CommonFunctions.CurrentDatabase();
            DateTime StartDate = UIStartDate.SelectedDate.Value;
            DateTime EndDate = UIEndDate.SelectedDate.Value;

            using (STS32Entities ctx = new STS32Entities())
            {
                SqlConnection caConn = new SqlConnection(CaConn);
                SqlCommand caCmd = new SqlCommand("CreateDynamicQuery", caConn);
                caCmd.CommandType = CommandType.StoredProcedure;
                caCmd.Parameters.Add(new SqlParameter("@DB", db));
                //caCmd.Parameters.Add(new SqlParameter("@SeqNo", SeqNo));
                //caCmd.Parameters.Add(new SqlParameter("@DataVrsn", UIDataVersion.SelectedItem.Text));
                caCmd.Parameters.Add(new SqlParameter("@SpecID", SpecID));
                caCmd.Parameters.Add(new SqlParameter("@DateType", UIEventType.SelectedValue));
                caCmd.Parameters.Add(new SqlParameter("@StartDate", StartDate.ToShortDateString()));
                caCmd.Parameters.AddWithValue("@EndDate", EndDate.ToShortDateString());
                caCmd.Parameters.Add(new SqlParameter("@HarvestCode", UIHarvestCode.Checked));

                caConn.Open();
                SqlDataReader caRdr = caCmd.ExecuteReader();

                gvTemp.DataSource = caRdr;
                gvTemp.DataBind();
                this.Form.Controls.Add(gvTemp);
                //Download.Enabled = true;
            }
            gvTemp.ExportSettings.IgnorePaging = true;
            gvTemp.ExportSettings.FileName = "DQRecords";
            gvTemp.ExportSettings.OpenInNewWindow = true;
            gvTemp.ExportSettings.Csv.FileExtension = "xls";
            gvTemp.ExportSettings.Csv.ColumnDelimiter = GridCsvDelimiter.Comma;
            gvTemp.MasterTableView.ExportToCSV();
            gvTemp.Visible = false;
        }







Kostadin
Telerik team
 answered on 05 Nov 2014
1 answer
186 views
Hi all,

how could we be able to expand/collapse a treeview without passing by the needdatasource event ?

I mean:
    we have a page with a treelist control.
The first load (!page.ispostback) we need to load it empty. The second load (page.ispostback) we load the treelist control with the results of a filter options.

If we click on expand/collapse button it doesn't work (expand/collapse)

Every time we  start an event, treelist goes on needdatasource event to load the object.

How could we be able to expand/collapse a treeview without passing by the needdatasource event , load it and click on expan/collapse button to expand or collapse nodes?

Hope you undestand.
Thank you

BR
Jesús

Kostadin
Telerik team
 answered on 05 Nov 2014
2 answers
118 views
Hello,

I've got an issue with one of my RadWindow. I want to refresh the parent page when there's a change in the RadWindow. For that, I use an arg when I close the RadWindow and catch that in the parent page :

RadWindow script :
function GetRadWindow() {
    var oWindow = null;
    if (window.radWindow)
        oWindow = window.radWindow;
    else if (window.frameElement.radWindow)
        oWindow = window.frameElement.radWindow;
    return oWindow;
}
 
function CloseWindowsWithArgument(arg) {
    var oWindow = GetRadWindow();
    oWindow.close(arg);
}
 
function CloseWindows() {
    var oWindow = GetRadWindow();
    oWindow.close();
}

The two close functions are call like that :
string scriptCloseWindow = modifiedItemCount > 0 ? "CloseWindowsWithArgument('NewData')" : "CloseWindows()";
 
ScriptManager.RegisterClientScriptBlock(this, typeof(Page), "saveCustomRainFall", scriptCloseWindow, true);

In the parent page, I've got this script :
function WindowsRainFallNewClose(sender, eventArgs) {
    // Explicitely instructed to reload
    if (eventArgs._argument != null) {
        window.location.reload();
    }
}

The RadWindow is declared like that :
<telerik:RadWindowManager ID="Singleton" runat="server" Behavior="Default" InitialBehavior="None" EnableEmbeddedSkins="False"
    Left="" meta:resourcekey="SingletonResource1" Style="display: none;" Top="" VisibleOnPageLoad="False" EnableViewState="False">
    <Windows>
        <telerik:RadWindow ID="DialogWindow" Skin="Bayer" EnableEmbeddedSkins="false" Behaviors="Maximize,Move,Reload,Resize,Close"
            ReloadOnShow="True" ShowContentDuringLoad="False" VisibleOnPageLoad="False" EnableViewState="False" OnClientClose="WindowsRainFallNewClose"
            Left="250px" Modal="true" runat="server" Width="300px" Height="400px" Title="Custom Rain Fall"
            NavigateUrl="GFTDonRisk_CustomRainFallNew.aspx" VisibleStatusbar="false" meta:resourcekey="DialogWindow">
        </telerik:RadWindow>
    </Windows>
</telerik:RadWindowManager>

When the parent page is reloaded, the page contained in the RadWindow also reloaded and I don't want that. I use a global script to show a loading bar when the pages are loading and close it when they are loaded. On the reload, the RadWindow don't finish its reload and it's blocking my loading bar (see the attach file : in red, the radwindow page. in yellow, the parent page).

How can I do to avoid the loading of the radwindow page after the "window.location.reload();" ?
Pierre-Antoine DOUCHET
Top achievements
Rank 1
 answered on 05 Nov 2014
3 answers
204 views
Rad window in side requiredfieldvalidator initially not working
   for example(I using validation group ,the validation group given all filed same when i click Rad button show the message "pleas fill all mandatory fields".
This is not perform initial ,after any "Auto post back" is done the validation is working  )
      


      pleas help me sample code(client side & sever side)
Marin Bratanov
Telerik team
 answered on 05 Nov 2014
7 answers
1.4K+ views
I would like to loop through every row in the grid, then check the checkbox on that row if checked, if it is I would require a datakeyvalue. This all need to be client side using javascript.

The problems I am having facing,

1) looping through the rows.
2) find a checkbox on the row.

Any help with this would be much appreciated.
Eyup
Telerik team
 answered on 05 Nov 2014
1 answer
210 views
hi,

I am want to fix the height and width of column which has image displayed. Actually, all the images being called in the cell are of different size this causes the design messed up.

I tried Item style height and width but it didn't solved the problem.

here is the code
<telerik:RadGrid ID="RadGrid_Banner_Home_Main" runat="server" AllowFilteringByColumn="True"
                        AutoGenerateColumns="false" AllowSorting="True" PageSize="10" ShowFooter="False"
                        ShowGroupPanel="False" AllowPaging="true" Skin="Vista" EnableLinqExpressions="false">
                        <PagerStyle Mode="NextPrevAndNumeric" />
                        <ExportSettings IgnorePaging="true" FileName="banner_Export" Pdf-AllowAdd="true"
                            Pdf-AllowCopy="true" Pdf-AllowPrinting="true" Pdf-PaperSize="A4" Pdf-Creator="a1"
                            OpenInNewWindow="true" ExportOnlyData="true" />
                        <MasterTableView DataKeyNames="banner_id" HorizontalAlign="NotSet" AutoGenerateColumns="False"
                            AllowFilteringByColumn="True" AllowSorting="true"  AlternatingItemStyle-BackColor="#f3f3f3"
                            CommandItemDisplay="Top" ClientDataKeyNames="banner_id">
                            <CommandItemSettings ShowExportToWordButton="false" ShowExportToExcelButton="false"
                                ShowExportToPdfButton="false" ShowExportToCsvButton="false" ShowAddNewRecordButton="false"
                                ShowRefreshButton="false" />
                            <NoRecordsTemplate>
                                Banner not available
                            </NoRecordsTemplate>
                            <SortExpressions>
                                <telerik:GridSortExpression FieldName="image" SortOrder="Ascending" />
                            </SortExpressions>
                            <Columns>
                                <telerik:GridTemplateColumn HeaderText="Banner" DataField="image" UniqueName="image"
                                    HeaderStyle-Width="100" ItemStyle-Width="100" ItemStyle-Height="100"
                                    AutoPostBackOnFilter="true" CurrentFilterFunction="Contains" ShowFilterIcon="false" AllowFiltering="false"
                                    GroupByExpression="image [Banner] Group By image">
 
                                    <ItemTemplate>
                                        <asp:Label ID="lbl_img_path" runat="server" Text='<%#Eval("image")%>' Visible="false"></asp:Label>
                                        <%# IIf(Container.DataItem("banner_type") <> "HTML", "" & "<img src=" & Gogotech.SqlHelper.of_FetchKey("FrontEndServer") & IIf(Eval("image") <> "", Eval("image"), "/images/ina.jpg") & " />" & "", "" & Eval("html") & "")%>
                                    </ItemTemplate>
                                </telerik:GridTemplateColumn>
      </Columns>
                        </MasterTableView>
               
                    </telerik:RadGrid>

Pavlina
Telerik team
 answered on 05 Nov 2014
4 answers
156 views
I am using the RadTreeList and have enabled scrolling. The RadTreeList reserves room at the bottom for a horizontal scroll bar whether or not a horizontal scroll bar is needed. How do I suppress the horizontal scroll bar or change the behavior so the RadTreeList does not reserve room at the bottom? In my case I never want a horizontal scroll bar to appear whether or not it is needed. 

Here is my code:

<telerik:RadTreeList ID="RadTreeView2" runat="server" DataKeyNames="ProductID" ParentDataKeyNames="ParentID" Height="350px"  
                  OnTreeNodeDataBound="RadTreeView2_TreeNodeDataBound" OnItemCommand="RadTreeView2_UpdateCommand"
    OnItemDataBound="RadTreeView2_ItemDataBound" OnCancelCommand="RadTreeView2_CancelCommand"
    OnNeedDataSource="RadTreeList2_NeedDataSource" EnableViewState="true" Width="100%"
    EditMode="InPlace" AllowMultiItemEdit="true" AutoGenerateColumns="False">
    <Columns>
        <telerik:TreeListBoundColumn DataField="ProductName" UniqueName="ProductName" Resizable="true" HeaderStyle-Width="100%"
            HeaderText="Product Name" >
        </telerik:TreeListBoundColumn>
        <telerik:TreeListNumericColumn DataField="Supply_FTE" UniqueName="Supply_FTE" HeaderText="Supply FTE" Resizable ="true"
            DecimalDigits="2" HeaderStyle-HorizontalAlign="Center" HeaderStyle-Width="100px"
            ItemStyle-Width="100px" NumericType="Number" ItemStyle-HorizontalAlign="Center"
            DataFormatString="{0:N2}">
        </telerik:TreeListNumericColumn>
        <telerik:TreeListNumericColumn DataField="Supply_Percent" UniqueName="Supply_Percent" Resizable ="true"
            NumericType="Percent" HeaderText="Supply Percent" HeaderStyle-HorizontalAlign="Center"
            HeaderStyle-Width="100px" ItemStyle-Width="100px" ItemStyle-HorizontalAlign="Center"
            DataFormatString="{0:P2}">
        </telerik:TreeListNumericColumn>
        <telerik:TreeListBoundColumn DataField="ResID" UniqueName="ResID" HeaderText="ResID" MaxWidth="0"
            Visible="false">
        </telerik:TreeListBoundColumn>
        <telerik:TreeListBoundColumn DataField="UserID" UniqueName="UserID" Visible="false" MaxWidth="0"
            HeaderText="UserID">
        </telerik:TreeListBoundColumn>
        <telerik:TreeListBoundColumn DataField="OrgID" UniqueName="OrgID" Visible="false" MaxWidth="0"
            HeaderText="OrgID">
        </telerik:TreeListBoundColumn>
        <telerik:TreeListEditCommandColumn UniqueName="Edit" ShowAddButton="False" ButtonType="ImageButton" Resizable="false"
            EditText="Edit" UpdateText="Update" Display="true" Visible="true" HeaderStyle-Width="55px" ItemStyle-Width="55px"
             MinWidth="55px" MaxWidth="55px"  >
        </telerik:TreeListEditCommandColumn>
    </Columns>
    <ClientSettings>
        <Scrolling AllowScroll="true" UseStaticHeaders="true" SaveScrollPosition="true"   />
        <Resizing AllowColumnResize="False"  EnableRealTimeResize="true"  />
    </ClientSettings>
</telerik:RadTreeList>
Galin
Telerik team
 answered on 05 Nov 2014
4 answers
171 views
I have a RadGrid, which is in batch edit mode that functionally works fine. There is however a cosmetic issue that I would like to resolve if possible.

When there are no records in the grid and the '+Add new record' option is clicked, the columns for the blank row that appears are misaligned with the column headings unless the browser window happens to be set at a particular width.

Once there is at least one record in the grid, everything aligns perfectly with both new and existing records. If I fix the with of all the columns then it all works fine but of course I do not want to do this.

I've attach screenshots to show the misalignment problem and here is my aspx code for the grid:
<telerik:RadGrid ID="RadGrid1" DataSourceID="ds_Logbook" AutoGenerateColumns="False"
    AllowSorting="True"
    AllowAutomaticDeletes="False"
    AllowAutomaticInserts="True"
    AllowAutomaticUpdates="True"
    AllowPaging="false" GridLines="None"
    EnableEmbeddedSkins="false" Skin="RAMtrackStdGrid" runat="server">
 
    <MasterTableView CommandItemDisplay="TopAndBottom" DataKeyNames="Logbook_id,Fault_Id"
        DataSourceID="ds_Logbook" HorizontalAlign="NotSet" EditMode="Batch" AutoGenerateColumns="False">
 
        <BatchEditingSettings EditType="Cell" />
 
        <Columns>
            <telerik:GridTemplateColumn UniqueName="LogDay" HeaderText="Day" DataField="LogDate" HeaderStyle-Width="40px">
                <ItemTemplate>
                    <asp:Label ID="lbl_LogDay" Text='<%# Eval("LogDay") %>' runat="server" />
                </ItemTemplate>
 
                <EditItemTemplate>
                    <asp:TextBox ID="txt_LogDay" Text='<%# Bind("LogDay") %>' Width="20px" runat="server" />
                </EditItemTemplate>
            </telerik:GridTemplateColumn>
 
            <telerik:GridDropDownColumn UniqueName="Activity_Id" HeaderText="Activity Code" DataField="Activity_Id" ListValueField="Activity_Id" ColumnEditorID="GridDropDownColumnEditor1"
                                        ListTextField="ActivityCode" DataSourceID="ds_ActivityCodes" SortExpression="Activity_Id" HeaderStyle-Width="60px">
                                        <ItemStyle Width="70px" />
                <ColumnValidationSettings EnableRequiredFieldValidation="true">
                    <RequiredFieldValidator ForeColor="Red" Text="*This field is required">
                    </RequiredFieldValidator>
                </ColumnValidationSettings>
            </telerik:GridDropDownColumn>
 
            <telerik:GridTemplateColumn UniqueName="StartTime" HeaderText="Start Time" DataField="StartTime" HeaderStyle-Width="80px">
                <ItemTemplate>
                    <asp:Label ID="lbl_StartTime" Text='<%# Eval("StartTime") %>' runat="server" />
                </ItemTemplate>
 
                <EditItemTemplate>
                    <telerik:RadTimePicker ID="tp_StartTime" Width="60px" SelectedDate='<%# Bind("StartTime") %>' Skin="Metro" runat="server">
                        <DateInput ID="DateInput2" CssClass="TimeField" Width="60px" runat="server">
                        </DateInput>
                        <TimeView ID="TimeView1" Interval="00:30:00" Columns="6" runat="server"></TimeView
                    </telerik:RadTimePicker>
                </EditItemTemplate>
            </telerik:GridTemplateColumn>
 
            <telerik:GridTemplateColumn UniqueName="StopTime" HeaderText="Stop Time" DataField="StopTime" HeaderStyle-Width="80px">
                <ItemTemplate>
                    <asp:Label ID="lbl_StopTime" Text='<%# Eval("StopTime") %>' runat="server" />
                </ItemTemplate>
 
                <EditItemTemplate>
                    <telerik:RadTimePicker ID="tp_StopTime" Width="60px" SelectedDate='<%# Bind("StopTime") %>' Skin="Metro" runat="server">
                        <DateInput ID="DateInput2" CssClass="TimeField" Width="60px" runat="server">
                        </DateInput>
                        <TimeView ID="TimeView1" Interval="00:30:00" Columns="6" runat="server"></TimeView
                    </telerik:RadTimePicker>
                </EditItemTemplate>
            </telerik:GridTemplateColumn>
 
            <telerik:GridTemplateColumn UniqueName="ProgComment" HeaderText="Comments" DataField="ProgComment" HeaderStyle-Width="300px">
                <ItemTemplate>
                        <asp:Label ID="lbl_ProgComment" Text='<%# Eval("ProgComment") %>' runat="server" />
                </ItemTemplate>
 
                <EditItemTemplate>
                    <telerik:RadEditor ID="re_ProgComment" Width="280px" Height="200px" EditModes="Design" Content='<%# Eval("ProgComment") %>' Skin="Metro" runat="server">
                        <Tools>
                            <telerik:EditorToolGroup>
                                <telerik:EditorTool Name="Bold"></telerik:EditorTool>
                                <telerik:EditorTool Name="Italic"></telerik:EditorTool>
                                <telerik:EditorTool Name="Underline"></telerik:EditorTool>
                                <telerik:EditorTool Name="Cut"></telerik:EditorTool>
                                <telerik:EditorTool Name="Copy"></telerik:EditorTool>
                                <telerik:EditorTool Name="Paste"></telerik:EditorTool>
                                <telerik:EditorTool Name="AjaxSpellCheck"></telerik:EditorTool>
                            </telerik:EditorToolGroup>
                        </Tools>
                    </telerik:RadEditor>
                </EditItemTemplate>
            </telerik:GridTemplateColumn>
 
            <telerik:GridDropDownColumn UniqueName="Event_Id" HeaderText="Incident type" DataField="Event_Id2" SortExpression="Event_Id2" ColumnEditorID="GridDropDownColumnEditor2"
                                        ListTextField="EventDescription" ListValueField="IncidentType" DataSourceID="ds_IncidentTypes" HeaderStyle-Width="100px">
            </telerik:GridDropDownColumn>
 
            <telerik:GridTemplateColumn UniqueName="TimeFaultOccurred" HeaderText="Time of Incident" DataField="TimeFaultOccurred" HeaderStyle-Width="80px">
                <ItemTemplate>
                    <asp:Label ID="lbl_TimeFaultOccurred" Text='<%# Eval("TimeFaultOccurred") %>' runat="server" />
                </ItemTemplate>
 
                <EditItemTemplate>
                    <telerik:RadTimePicker ID="tp_TimeFaultOccurred" Width="60px" SelectedDate='<%# Bind("TimeFaultOccurred") %>' Skin="Metro" runat="server">
                        <DateInput ID="DateInput2" CssClass="TimeField" Width="60px" runat="server">
                        </DateInput>
                        <TimeView ID="TimeView1" Interval="00:30:00" Columns="6" runat="server"></TimeView
                    </telerik:RadTimePicker>
                </EditItemTemplate>
            </telerik:GridTemplateColumn>
 
            <telerik:GridTemplateColumn UniqueName="FaultSymptom" HeaderText="Symptoms" DataField="FaultSymptom" HeaderStyle-Width="300px">
                <ItemTemplate>
                    <asp:Label ID="lbl_FaultSymptom" Text='<%# Eval("FaultSymptom") %>' runat="server" />
                </ItemTemplate>
 
                <EditItemTemplate>
                    <telerik:RadEditor ID="re_Symptoms" Width="280px" Height="200px" EditModes="Design" Content='<%# Eval("FaultSymptom") %>' Skin="Metro" runat="server">
                        <Tools>
                            <telerik:EditorToolGroup>
                                <telerik:EditorTool Name="Bold"></telerik:EditorTool>
                                <telerik:EditorTool Name="Italic"></telerik:EditorTool>
                                <telerik:EditorTool Name="Underline"></telerik:EditorTool>
                                <telerik:EditorTool Name="Cut"></telerik:EditorTool>
                                <telerik:EditorTool Name="Copy"></telerik:EditorTool>
                                <telerik:EditorTool Name="Paste"></telerik:EditorTool>
                                <telerik:EditorTool Name="AjaxSpellCheck"></telerik:EditorTool>
                            </telerik:EditorToolGroup>
                        </Tools>
                    </telerik:RadEditor>
                </EditItemTemplate>
            </telerik:GridTemplateColumn>
 
            <telerik:GridBoundColumn UniqueName="LogDate" HeaderText="" DataField="LogDate" AllowFiltering="false" ReadOnly="true" HeaderStyle-Width="1px" >
            </telerik:GridBoundColumn>
 
            <telerik:GridBoundColumn UniqueName="Logbook_Id" HeaderText="" DataField="Logbook_Id" AllowFiltering="false" ReadOnly="true" HeaderStyle-Width="1px" >
            </telerik:GridBoundColumn>
 
            <telerik:GridBoundColumn UniqueName="Fault_Id" HeaderText="" DataField="Fault_Id" AllowFiltering="false" ReadOnly="true" HeaderStyle-Width="1px" >
            </telerik:GridBoundColumn>
 
            <telerik:GridBoundColumn UniqueName="status" HeaderText="" DataField="status" AllowFiltering="false" ReadOnly="true" HeaderStyle-Width="1px" >
            </telerik:GridBoundColumn>
        </Columns>
 
    </MasterTableView>
 
    <ClientSettings>
        <Scrolling AllowScroll="True" UseStaticHeaders="True" SaveScrollPosition="true" FrozenColumnsCount="0"></Scrolling>
        <ClientEvents OnCommand="gridCommand" />
    </ClientSettings>
</telerik:RadGrid>
Geoff
Top achievements
Rank 1
 answered on 05 Nov 2014
3 answers
310 views
Hi,

In it's simplest form I have a RadGrid containing a Milestone indicator column, a Title and a Value.
If the particular row is a Milestone, then this should not have an associated value.

I am unsure how to get a reference to whether the current row is a 'Milestone' row and, if so, simply hide the label that is generated for the 'External Costs' column.

My grid is structured as follows (simplified): -

<telerik:RadGrid ID="costingGrid" runat="server" RenderMode="Auto" OnNeedDataSource="costingGrid_NeedDataSource" AllowAutomaticUpdates="true" ClientSettings-AllowKeyboardNavigation="true">
<ClientSettings>
            <Selecting AllowRowSelect="true" />
            <ClientEvents OnRowCreated="gridRowCreated" />
            <Scrolling AllowScroll="true" UseStaticHeaders="true" />
        </ClientSettings>
<MasterTableView AutoGenerateColumns="false" DataKeyNames="ID" Width="100%" EditMode="Batch" CommandItemDisplay="Top" ShowFooter="true">
<BatchEditingSettings EditType="Cell" OpenEditingEvent="Click" />
<Columns>
<telerik:GridBoundColumn UniqueName="ID" DataField="ID" Visible="false" />
                <telerik:GridBoundColumn UniqueName="IsMilestone" DataField="IsMilestone" Display="false" />
<telerik:GridTemplateColumn UniqueName="Title" DataField="Title" HeaderText="Title" HeaderStyle-Width="400px" >
                    <ItemTemplate>
                        <asp:Label ID="titleLabel" runat="server" Width="100%" Text='<%#Bind("Title") %>' />
                    </ItemTemplate>
                    <EditItemTemplate>
                        <telerik:RadTextBox ID="titleInput" runat="server" Width="100%" TextMode="MultiLine" />
                    </EditItemTemplate>
                </telerik:GridTemplateColumn>
<telerik:GridBoundColumn UniqueName="ExternalCosts" DataField="ExternalCosts" HeaderText="3rd Party Costs" HeaderStyle-Width="80px"  DataFormatString="{0:N2}" HeaderStyle-HorizontalAlign="Right" ItemStyle-HorizontalAlign="Right" Aggregate="Sum" FooterAggregateFormatString="£{0:F2}" />
</MasterTableView>
    </telerik:RadGrid>

<telerik:RadScriptBlock runat="server">
        <script type="text/javascript">
             
            function gridRowCreated(sender, args) {
 
            }
        </script>
    </telerik:RadScriptBlock>
protected void costingGrid_NeedDataSource(object sender, GridNeedDataSourceEventArgs e)
        {
            costingGrid.DataSource = CurrentCosting.Lines.OrderBy(l => l.LineNumber).ToList();
        }

Many thanks,
Mike.
Jay
Top achievements
Rank 3
Bronze
Iron
Iron
 answered on 04 Nov 2014
Narrow your results
Selected tags
Tags
+? more
Top users last month
Top achievements
Rank 1
Iron
Iron
Iron
Rob
Top achievements
Rank 3
Bronze
Bronze
Iron
ivory
Top achievements
Rank 1
Iron
Nurik
Top achievements
Rank 2
Iron
Iron
YF
Top achievements
Rank 1
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
Top achievements
Rank 1
Iron
Iron
Iron
Rob
Top achievements
Rank 3
Bronze
Bronze
Iron
ivory
Top achievements
Rank 1
Iron
Nurik
Top achievements
Rank 2
Iron
Iron
YF
Top achievements
Rank 1
Iron
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?