Telerik Forums
UI for ASP.NET AJAX Forum
7 answers
123 views
Hi! I have an page with Telerik that uses TreeView concept.
I use GroupByExpression to construct nodes. But I need construct in my C# an logic that transform an row in SQL with Folders Path in an line in my GridView.
Ex:
In my SQL I have an column FolderPath and value is "N:\Test\Drive\FolderTest".
I need transform this in nodes, or grouping this to ex:

- N:\
  - Test\
    - Drive\
      -FolderTest\

How I make it (Nodes or Grouping) in C#?

Below is my aspx actual.
<form id="form1" runat="server">
<Telerik:RadScriptManager runat="server" ID="RadScriptManager1" />
<Telerik:RadSkinManager ID="QsfSkinManager" runat="server" ShowChooser="false" />
<Telerik:RadFormDecorator ID="QsfFromDecorator" runat="server" DecoratedControls="All"
    EnableRoundedCorners="false" />
<Telerik:RadAjaxManager ID="RadAjaxManager1" runat="server">
    <AjaxSettings>
        <Telerik:AjaxSetting AjaxControlID="RadGrid1">
            <UpdatedControls>
                <Telerik:AjaxUpdatedControl ControlID="RadGrid1" LoadingPanelID="RadAjaxLoadingPanel1">
                </Telerik:AjaxUpdatedControl>
            </UpdatedControls>
        </Telerik:AjaxSetting>
    </AjaxSettings>
</Telerik:RadAjaxManager>
<Telerik:RadAjaxLoadingPanel ID="RadAjaxLoadingPanel1" runat="server">
</Telerik:RadAjaxLoadingPanel>
<div align="center" style="width: auto; height: auto;">
    <img src="image/NdriveBanner.png" align="center" />
</div>
<br />
<br />
<Telerik:RadGrid ID="RadGrid1" DataSourceID="SqlDataSource1" runat="server" AllowSorting="True"
    AllowPaging="True" AutoGenerateColumns="False" GridLines="None">
    <PagerStyle Mode="NumericPages"></PagerStyle>
    <MasterTableView Width="100%" GroupLoadMode="Client" TableLayout="Fixed" GroupsDefaultExpanded="false">
        <PagerStyle Visible="false" />
        <GroupByExpressions>
            <Telerik:GridGroupByExpression>
                <SelectFields>
                    <Telerik:GridGroupByField FieldAlias="REGION" FieldName="REGION"></Telerik:GridGroupByField>
                </SelectFields>
                <GroupByFields>
                    <Telerik:GridGroupByField FieldName="REGION"></Telerik:GridGroupByField>
                </GroupByFields>
            </Telerik:GridGroupByExpression>
            <Telerik:GridGroupByExpression>
                <SelectFields>
                    <Telerik:GridGroupByField FieldAlias="MARKET" FieldName="MARKET"></Telerik:GridGroupByField>
                </SelectFields>
                <GroupByFields>
                    <Telerik:GridGroupByField FieldName="MARKET"></Telerik:GridGroupByField>
                </GroupByFields>
            </Telerik:GridGroupByExpression>
            <Telerik:GridGroupByExpression>
                <SelectFields>
                    <Telerik:GridGroupByField FieldAlias="LOCATIONNAME" FieldName="LOCATIONNAME"></Telerik:GridGroupByField>
                </SelectFields>
                <GroupByFields>
                    <Telerik:GridGroupByField FieldAlias="LOCATIONNAME" FieldName="LOCATIONNAME"></Telerik:GridGroupByField>
                </GroupByFields>
            </Telerik:GridGroupByExpression>
        </GroupByExpressions>
        <Columns>
            <Telerik:GridBoundColumn SortExpression="REGION" HeaderText="REGION" HeaderButtonType="TextButton"
                DataField="REGION">
            </Telerik:GridBoundColumn>
            <Telerik:GridBoundColumn SortExpression="MARKET" HeaderText="MARKET" HeaderButtonType="TextButton"
                DataField="MARKET">
            </Telerik:GridBoundColumn>
            <Telerik:GridHyperLinkColumn DataNavigateUrlFields="IDSERVER" DataNavigateUrlFormatString="PathFolders.aspx?idServer={0}"
                DataTextField="LOCATIONNAME" FilterControlAltText="Filter column column" HeaderText="LOCATION NAME"
                UniqueName="column">
                <ItemStyle HorizontalAlign="Left" />
            </Telerik:GridHyperLinkColumn>
            <Telerik:GridBoundColumn SortExpression="SERVERNAME" HeaderText="SERVER NAME" HeaderButtonType="TextButton"
                DataField="SERVERNAME">
            </Telerik:GridBoundColumn>
        </Columns>
    </MasterTableView>
    <ClientSettings ReorderColumnsOnClient="True" AllowDragToGroup="True" AllowColumnsReorder="True">
        <ClientEvents OnGridCreated="demo.GridCreated" />
    </ClientSettings>
    <GroupingSettings ShowUnGroupButton="true"></GroupingSettings>
</Telerik:RadGrid>
<br />
<asp:SqlDataSource ID="SqlDataSource1" ConnectionString="<%$ ConnectionStrings:dbNDriveSecurityConnectionString %>"
    ProviderName="System.Data.SqlClient" SelectCommand="SELECT IDLOCATION,REGION,MARKET,LOCATIONNAME,SERVERNAME,IDSERVER FROM LOCATIONS L INNER JOIN [SERVERS] S ON l.LocationCode = s.LocationCode ORDER BY Region,Market,LocationName,ServerName"
    runat="server"></asp:SqlDataSource>
</form>
Boyan Dimitrov
Telerik team
 answered on 27 Aug 2013
3 answers
79 views
Hi

I am trying to display a context menu on a div using radcontextmenu.showAt(). The issue is initially the radmenu is displayed and suddenly the browser context menu appear over it. How to resolve this?
Shinu
Top achievements
Rank 2
 answered on 27 Aug 2013
2 answers
331 views
Hi i using a HtmlChart - Column Chart.

How can i had an horizontal passing line in my chart.
I would like to one put a passing line at 55

Please refer to this link a put an horontal line in photoshop to show you what i need.
Exemple

For now i use this code :
Tks
<telerik:RadHtmlChart runat="server" ChartTitle-Text="Courbe FR" ID="RadHtmlChart1" Width="800" Height="500">
          <PlotArea>
               <Series>
                    <telerik:ColumnSeries Name="District">
                         <TooltipsAppearance Color="White" />
                         <SeriesItems>
                              <telerik:CategorySeriesItem Y="95" />
                              <telerik:CategorySeriesItem Y="80" />
                              <telerik:CategorySeriesItem Y="80" />
                              <telerik:CategorySeriesItem Y="85" />
                         </SeriesItems>
                    </telerik:ColumnSeries>
 
                    <telerik:ColumnSeries AxisName="AdditionalAxis" Name="Ministère">
                         <Appearance>
                              <FillStyle BackgroundColor="Red" />
                         </Appearance>
 
                         <TooltipsAppearance Color="White" />
                         <SeriesItems>
                              <telerik:CategorySeriesItem Y="90" />
                              <telerik:CategorySeriesItem Y="80" />
                              <telerik:CategorySeriesItem Y="45" />
                              <telerik:CategorySeriesItem Y="66" />
                         </SeriesItems>
                    </telerik:ColumnSeries>
                    
               </Series>
 
               <YAxis MinValue="0">
                    <TitleAppearance Text="%" />
               </YAxis>
 
               <AdditionalYAxes>
                    <telerik:AxisY Name="AdditionalAxis" Visible="false" Color="Red" Width="3">
                         <TitleAppearance Text="%" Visible="false" />
                    </telerik:AxisY>
               </AdditionalYAxes>
               <Series>
                <telerik:BarSeries Name="Seuil">
                       <Appearance>
                            <FillStyle BackgroundColor="Red"></FillStyle>
                       </Appearance>
 
                       <LabelsAppearance Position="Center">
                       </LabelsAppearance>
 
                       <TooltipsAppearance BackgroundColor="Red"></TooltipsAppearance>
                       <SeriesItems>
                            <telerik:CategorySeriesItem Y="55"></telerik:CategorySeriesItem>
                       </SeriesItems>
                  </telerik:BarSeries>
               </Series>
               <XAxis>
                    <LabelsAppearance />
                    <Items>
                         <telerik:AxisItem LabelText="L2" />
                         <telerik:AxisItem LabelText="L4" />
                         <telerik:AxisItem LabelText="F5" />
                         <telerik:AxisItem LabelText="F8" />
                    </Items>
               </XAxis>
          </PlotArea>
 
          <Legend>
               <Appearance Position="Bottom" />
          </Legend>
 
     </telerik:RadHtmlChart>



Danail Vasilev
Telerik team
 answered on 27 Aug 2013
7 answers
162 views
Team

I am having issue on grid exapand button click.

In my example I am hiding some buttons on Grid Item Data bound event. It works fiine all case but In case of Expand click it displaying all button on screen.

I don't want to display button on certain status

If "Success"
   The Button Hide
Else If "Pending"
   Display button

Jayesh Goyani
Top achievements
Rank 2
 answered on 27 Aug 2013
1 answer
106 views

I've been working with the RadFilter, and have added a RadFilterTextFieldEditor to the RadFilter which is set to a DataType of System.Guid.  When I pass the expression into a LinqDynamic query, it throws an exception:

ParseException:
Operator '==' incompatible with operand types 'Guid' and 'Object'

The RadFilter expression:
"(iif(it.UniqueId==null,\"\",it.UniqueId).ToString().ToUpper() = \"12345678-926F-44A9-936B-CDBB03DA888A\".ToUpper())"

Declarative code:
<telerik:RadFilterTextFieldEditor DataType="System.Guid" FieldName="UniqueId" DisplayName="Package Unique ID" />

Linq Query:

if (!string.IsNullOrEmpty(packageFilterExpression))

{

query = query

   .Where(packageFilterExpression);

}


Note:  I have researched this some and arrived at the following suggested workaround, however the suggestion to modify the LinqDynamic class in this case still doesn't work with the expression syntax generated by the RadFilter.

https://connect.microsoft.com/VisualStudio/feedback/details/333262/system-linq-dynamic-throws-an-error-when-using-guid-equality-in-where-clause

Additionally, when I add filtering to a RadGrid, to see how it generates a filter expression, I see that the expression is different, and consequently works.

The RadGrid expression:

"(UniqueId = Guid(\"12345678-926F-44A9-936B-CDBB03DA888A\"))"

Any assistance or verification the RadFilter actually works with a System.Guid would be appreciated!

Thanks!
Maria Ilieva
Telerik team
 answered on 27 Aug 2013
1 answer
146 views
Hi, 

I have a user control which has several RadComboBoxes with CheckBoxes set to True.

Some of these combo boxes have cascading datasources and have TextChanged events so when the user changes what items are checked it will re-bind the relevant controls that use this selection.

On the page I have a standard ASP.NET button which gets the values from these combo boxes and updates a chart and table etc.  When this button is clicked it is triggering the TextChanged events of the combo boxes which is making the combo boxes think nothing is selected when you can physically see items checked.

I have four combo boxes, ddlProject, ddlUnit, ddlDiscipline and ddlDocType.  ddlProject binds unit, discipline and doc type and unit/discipline update doc type.  Values don't need to be selected for these for the datasource as if there are no selected items then the SQL statements ignores this in the where clause.

If I don't select anything in unit or discipline there ddlDocType still binds and I can select items but when I click my button the TextChanged events fire and the CheckedItems for ddlDocType is 0.  If I have items selected in unit and discipline CheckItems for ddlDocType gives the correct number.

This is the structure of the combo boxes

<telerik:RadComboBox ID="ddlUnit" runat="server" CheckBoxes="true" EnableCheckAllItemsCheckBox="true"
   MaxHeight="450px" Width="300px" DataTextField="Value" DataValueField="Key" Label="Unit:"
   LabelCssClass="HeaderLabel" DropDownWidth="600px" Height="400px"
   AutoPostBack="true" OnTextChanged="ddlUnit_TextChanged">
</telerik:RadComboBox>

This is an example of the OnTextChanged event

protected void ddlDiscipline_TextChanged(object sender, EventArgs e)
{
    CTRmDataService ctrmDS = new CTRmDataService();
 
    this.ddlDocType.DataSource = ctrmDS.GetDocumentTypesForProjectsDisciplineAndUnit(GetSelectedProjects(),
                                                                                GetSelectedDisciplines(),
                                                                                GetSelectedUnits(),
                                                                                LoggedOnUser.Id);
    this.ddlDocType.DataBind();
}

My user control has methods to make the selected items accessible such as :

public string[] GetSelectedDocTypes()
{
    return ddlDocType.CheckItems.Where(x => x.Value != "PSP")
                       .Select(v => v.Value).ToArray<string>();
}

I've been looking at this for quite a while now trying to figure out why the Telerik control events are being fired when I click the button and why the ddlDocType CheckedItems is bringing back nothing when nothing is selected in Unit/Discipline.

Can anyone help?

Nencho
Telerik team
 answered on 27 Aug 2013
1 answer
165 views
Need help if gird is empty then hide filter icon of grid.
Princy
Top achievements
Rank 2
 answered on 27 Aug 2013
1 answer
111 views
Hi

I having trouble on missing Rad editor icons (we are using the custom simpletools.xml to populate the list and fiddler shows no missing images)on only one website on the server, other websites that use the editor are working just fine.

Can you please help me with this issue?

Thanks
Marin Bratanov
Telerik team
 answered on 27 Aug 2013
1 answer
343 views
Based on some business rules on my form, I'd like to be able to disable/enable the RadAsyncUpload control on the client side.  Essentially, based on values entered by the user, the RadAsyncUpload control should either allow or disallow further uploads.  The one caveat is that if a user uploads files before the RadAsyncUpload control is disabled, those files SHOULD be uploaded when the page posts back.

I have tried using the set_enabled method, which does in fact disable/enable the control, however, if the control is disabled when the user submits the page, it seems like the FileUploaded server side event doesn't happen (the files are transported to the temporary folder, but the UploadedFiles parameter will be 0 and the FileUploaded event will not fire).

I've also tried disabling the "select" button of the control but "click" events in the telerik upload area still allow for browsing so disabling the button didn't really do anything for me. 

Any suggestions? 
Shinu
Top achievements
Rank 2
 answered on 27 Aug 2013
1 answer
87 views
I am creating images to be used on the RibbonBar. 

I will be creating 16x16 and 32x32 images for each item on the bar.  My question is, what is the dpi needed?  And do you support multiple dpi, as Microsoft's ribbon framework does?

Microsoft suggests multiple images; one for each of these dpi:  96, 120, 144, and 192.  Can the RibbonBar use these images and adjust to the variety of screen sizes and resolutions we have today... from mobile to tablet to laptop to desktop?

Thank you,
Janice
Ivan Zhekov
Telerik team
 answered on 27 Aug 2013
Narrow your results
Selected tags
Tags
+? more
Top users last month
Chester
Top achievements
Rank 1
Iron
Simon
Top achievements
Rank 1
Iron
Douglas
Top achievements
Rank 2
Iron
Iron
SUNIL
Top achievements
Rank 3
Iron
Iron
Iron
Marco
Top achievements
Rank 3
Iron
Iron
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
Chester
Top achievements
Rank 1
Iron
Simon
Top achievements
Rank 1
Iron
Douglas
Top achievements
Rank 2
Iron
Iron
SUNIL
Top achievements
Rank 3
Iron
Iron
Iron
Marco
Top achievements
Rank 3
Iron
Iron
Iron
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?