Telerik Forums
UI for ASP.NET AJAX Forum
1 answer
436 views

Hello!

As you can see in the image that I attached, my radgrid has 2 buttons at the bottom (Valider & Annuler) which stands for Validate and Cancel in english. These buttons are added as the following:


<EditFormSettings>
     <EditColumn FilterControlAltText="Filter EditCommandColumn column" ButtonType="PushButton" InsertText="Valider" CancelText="Annuler" EditText="Modif" UpdateText="Valider">
     </EditColumn>
</EditFormSettings>

I would like to change their design and apply a skin.  I have applied the Material skin to the whole RadGrid however these buttons seem to not be affected by that. Would that be possible to style them, just like we style any radbutton using Skins? Would changing the ButtonType from pushbutton to another type help with this matter?

 

Here's the full code of the radgrid shown in the attached image:


<telerik:RadGrid ID="RadGrid1" runat="server" CellSpacing="0" Culture="French (France)"
            DataSourceID="SDS_Notes" GridLines="None" Width="775px" Skin="Material" 
            AllowAutomaticInserts="True" AutoGenerateEditColumn="True">
            <HeaderContextMenu CssClass="GridContextMenu GridContextMenu_Default">
            </HeaderContextMenu>
            <MasterTableView AutoGenerateColumns="False" CommandItemDisplay="Top" DataSourceID="SDS_Notes"
                NoMasterRecordsText="Aucune note" DataKeyNames="NumNote" 
                AllowAutomaticUpdates="True"
                Font-Size="13px">
                <CommandItemSettings ExportToPdfText="Export to PDF" AddNewRecordText="Ajouter une note"
                    RefreshText="Rafraichir"></CommandItemSettings>
                <RowIndicatorColumn FilterControlAltText="Filter RowIndicator column">
                    <HeaderStyle Width="20px"></HeaderStyle>
                </RowIndicatorColumn>
                <ExpandCollapseColumn FilterControlAltText="Filter ExpandColumn column">
                    <HeaderStyle Width="20px"></HeaderStyle>
                </ExpandCollapseColumn>
                <Columns>
                    <telerik:GridDropDownColumn DataField="AgenceAction" FilterControlAltText="Filter AgenceAction column"
                        HeaderText="Agence" SortExpression="AgenceAction" UniqueName="AgenceAction" HeaderStyle-Width="61px" DataSourceID="SDSAgence" ListTextField="AgenceAction" ListValueField="AgenceAction" ItemStyle-Width="130px">
                        <HeaderStyle Font-Size="15px" Width="80px"></HeaderStyle>
                        </telerik:GridDropDownColumn>
                    <telerik:GridDateTimeColumn DataField="DateAction" DataType="System.DateTime" FilterControlAltText="Filter DateAction column"
                        HeaderText="Date Action" SortExpression="DateAction" UniqueName="DateAction"
                        DataFormatString="{0:dd/MM/yyyy}" HeaderStyle-Width="110px">
                        <HeaderStyle Font-Size="15px" Width="130px"></HeaderStyle>
                    </telerik:GridDateTimeColumn>
                    <telerik:GridDateTimeColumn DataField="HeureAction" DataType="System.DateTime" FilterControlAltText="Filter HeureAction column"
                        HeaderText="Heure" SortExpression="HeureAction" UniqueName="HeureAction" PickerType="TimePicker" 
                        DataFormatString="{0:HH:mm}" HeaderStyle-Width="70px">
                        <HeaderStyle Font-Size="15px" Width="60px"></HeaderStyle>
                    </telerik:GridDateTimeColumn>
                    <telerik:GridBoundColumn DataField="Observations" FilterControlAltText="Filter Observations column"
                        HeaderText="Observations" SortExpression="Observations" UniqueName="Observations"
                        HeaderStyle-Width="500px" MaxLength="105">
                        <HeaderStyle Font-Size="15px" Width="500px"></HeaderStyle>
                        <ItemStyle CssClass="form-control" />
                    </telerik:GridBoundColumn>
                </Columns>
                <EditFormSettings>
                    <EditColumn FilterControlAltText="Filter EditCommandColumn column" ButtonType="PushButton" InsertText="Valider" CancelText="Annuler" EditText="Modif" UpdateText="Valider">
                    </EditColumn>
                </EditFormSettings>
                <HeaderStyle BackColor="#757575" Font-Bold="false" ForeColor="White"/>

            </MasterTableView>
            <FilterMenu EnableImageSprites="False">
            </FilterMenu>
        </telerik:RadGrid>

I have tried setting the SkinID from codebehind in the itemcreated property however I am receiving the following error:

"The 'SkinId' property can only be set in or before the Page_PreInit event for static controls. For dynamic controls, set the property before adding it to the Controls collection."


    Protected Sub RadGrid1_ItemCreated(ByVal sender As Object, ByVal e As Telerik.Web.UI.GridItemEventArgs) Handles RadGrid1.ItemCreated
    If TypeOf e.Item Is GridEditableItem AndAlso e.Item.IsInEditMode Then
        If Not e.Item.OwnerTableView.IsItemInserted Then
            '[......]
        Else
            '[......]
        End If
        Dim cancelButton As Button = CType(e.Item.FindControl("CancelButton"), Button)
            cancelButton.SkinID = "Material"
    End If
End Sub

Thanks a lot!
Valentin Dragnev
Telerik team
 answered on 25 Aug 2022
1 answer
183 views

Hi,

 

  1. When a large image is uploaded – say, 3MB(+), does the editor allow to programmatically reduce the image file size saved on server side?
  2. If yes, how to do that? If not, is Telerik planning to support this kind of feature?
  3. If Telerik doesn’t support and is not planning to support this feature, is there any event of the editor that can be used to trigger extra code to do this job?

 

Thanks,

Tim

Rumen
Telerik team
 updated answer on 25 Aug 2022
4 answers
320 views

i have radEditor in web Project.

i click to image manager in radEditor and upload file by Upload Botton. example my file is "MyFile.jpg". my file save in server path whit name "MyFile.jpg".

i want to Change filename after upload in server and save it. i write FileUpload event:


public bool RadEditor1_FileUpload(object sender, string fileName)  
 
{ 
 
string FileNameTemp = fileName.Substring(fileName.LastIndexOf("/") + 1);  
 
  
 
 
string strExtension = System.IO.Path.GetExtension(FileNameTemp);  
 
 
 
FileNameTemp = FileNameTemp + 
 
"-" + Guid.NewGuid() + strExtension;  
 
fileName
= fileName.Substring(0, fileName.LastIndexOf( 
 
"/") + 1) + FileNameTemp;  
 
  
 
return true;  
 
}

but file save yet whit name "MyFile.jpg".


secend question me :
how insert image by src:'http://Address Image' in run time RadEditor. in Insert Manager certainly should upload image.
i whold not use from HTML code.

please help me.




Rumen
Telerik team
 updated answer on 25 Aug 2022
0 answers
224 views

Hi,

I have 1 RadComboBox which has some data in it. Until I change any value in RadComboBox it works perfectly but as soon as I change the value in RadComboBox then After each postback, it gets focused and not the control which caused the postback.

 

e.g.  I select a value in dropdown (ASP.Net dropdown)  -->  Enter some text in TextBox -->  then search some value and select 1 from result in RadComboBox  --> Then click on 1 button / select some different value in dropdown (ASP.Net dropdown) then the RadComboBox gets focused.

Javed
Top achievements
Rank 1
 asked on 24 Aug 2022
0 answers
197 views

I'm using Q2 2015 (2015.2.826.45). The code uses RadEditor -> DocumentManager to do the file uploading. The function had been working good without any issue. But recently the code will throw exception when uploading a file. The error message is: 

    System.IO.FileNotFoundException: Could not find file 'C:\inetpub\...\App_Data\RadUploadTemp\1661261184840UploadTest.pdf.tmp'.

Did investigation. I can see that the temp file has been uploaded into the temp folder on server. However, once clicked the button “Upload” on the Upload dialog, the exception happened. I can see that after clicking the button “Upload”, the temp file was gone, but somehow the uploaded file was not moved to the target folder. It seems there's duplicate request happening which caused this exception. The exception happens on all browser (IE11, Edge and Chrome). What might be the reason?

Sheng
Top achievements
Rank 1
Iron
Iron
 asked on 23 Aug 2022
3 answers
538 views
Hi,

The code below does not result in the RadComboBox being resized to a width of 35 em. How should I do that?

<telerik:GridDropDownColumn UniqueName="ProductVariant" ListTextField="name" ListValueField="id"             DataSourceID="LinqDataSourceProductVariant" HeaderText="Product variant*" DataField="product_variant"  DropDownControlType="RadComboBox" AllowSorting="true" AllowFiltering="false" ItemStyle-Width="35em">
</telerik:GridDropDownColumn>

By the way, it works when I set the DropDownControlType to be a regular DropDownList, but then the dropdownlist is not styled like to other items:

<telerik:GridDropDownColumn UniqueName="ProductVariant" ListTextField="name" ListValueField="id"
DataSourceID="LinqDataSourceProductVariant" HeaderText="Product variant*" DataField="product_variant"
DropDownControlType="DropDownList" AllowSorting="true" AllowFiltering="false"
ItemStyle-Width="35em">
</telerik:GridDropDownColumn>
Johnny
Top achievements
Rank 3
Bronze
Iron
Iron
 updated answer on 22 Aug 2022
1 answer
130 views

Hi,

When I change the font for the combo box the arrow icon size does not change.

How to change the arrow size?

Thanks in advance,

Omar

Valentin Dragnev
Telerik team
 answered on 19 Aug 2022
1 answer
230 views

Hello everyone.

I just can't manage to upgrade my RadChart to a RadHtmlChart because of the differences...

Is there an easier way than doing it manually?

Any sort of help is appreciated. Thanks!


<telerik:RadChart ID="RadChart1" runat="server" DataGroupColumn="jours" 
                            DataSourceID="SDSGraph7I" Skin="Mac" Width="800px">
                            <Series>
                                <telerik:ChartSeries DataYColumn="valeur" Name="J">
                                    <Appearance>
                                        <FillStyle MainColor="55, 167, 226" SecondColor="22, 85, 161">
                                            <FillSettings GradientMode="Vertical">
                                            </FillSettings>
                                        </FillStyle>
                                        <TextAppearance TextProperties-Color="Black">
                                        </TextAppearance>
                                    </Appearance>
                                </telerik:ChartSeries>
                                <telerik:ChartSeries DataYColumn="valeur" Name="J+1">
                                    <Appearance>
                                        <FillStyle MainColor="223, 87, 60" SecondColor="200, 38, 37">
                                            <FillSettings GradientMode="Vertical">
                                            </FillSettings>
                                        </FillStyle>
                                        <TextAppearance TextProperties-Color="Black">
                                        </TextAppearance>
                                    </Appearance>
                                </telerik:ChartSeries>
                                <telerik:ChartSeries DataYColumn="valeur" Name="J+2">
                                    <Appearance>
                                        <FillStyle MainColor="118, 203, 76" SecondColor="73, 166, 22">
                                            <FillSettings GradientMode="Vertical">
                                            </FillSettings>
                                        </FillStyle>
                                        <TextAppearance TextProperties-Color="Black">
                                        </TextAppearance>
                                    </Appearance>
                                </telerik:ChartSeries>
                                <telerik:ChartSeries DataYColumn="valeur" Name="J+3">
                                    <Appearance>
                                        <FillStyle MainColor="119, 83, 76" SecondColor="88, 59, 52">
                                            <FillSettings GradientMode="Vertical">
                                            </FillSettings>
                                        </FillStyle>
                                        <TextAppearance TextProperties-Color="Black">
                                        </TextAppearance>
                                    </Appearance>
                                </telerik:ChartSeries>
                                <telerik:ChartSeries DataYColumn="valeur" Name="J+4">
                                    <Appearance>
                                        <FillStyle MainColor="255, 222, 0" SecondColor="242, 188, 0">
                                            <FillSettings GradientMode="Vertical">
                                            </FillSettings>
                                        </FillStyle>
                                        <TextAppearance TextProperties-Color="Black">
                                        </TextAppearance>
                                    </Appearance>
                                </telerik:ChartSeries>
                                <telerik:ChartSeries DataYColumn="valeur" Name="J+5">
                                    <Appearance>
                                        <FillStyle MainColor="164, 65, 221" SecondColor="125, 24, 167">
                                            <FillSettings GradientMode="Vertical">
                                            </FillSettings>
                                        </FillStyle>
                                        <TextAppearance TextProperties-Color="Black">
                                        </TextAppearance>
                                    </Appearance>
                                </telerik:ChartSeries>
                                <telerik:ChartSeries DataYColumn="valeur" Name="J+6">
                                </telerik:ChartSeries>
                            </Series>
                            <PlotArea>
                                <XAxis AutoScale="False" DataLabelsColumn="grpcattarif" MaxValue="4" 
                                    MinValue="1" Step="1">
                                    <Appearance Color="134, 134, 134" MajorTick-Color="134, 134, 134">
                                        <MajorGridLines Color="209, 222, 227" PenStyle="Solid" />
                                        <TextAppearance TextProperties-Color="51, 51, 51">
                                        </TextAppearance>
                                    </Appearance>
                                    <AxisLabel>
                                        <TextBlock>
                                            <Appearance TextProperties-Color="51, 51, 51">
                                            </Appearance>
                                        </TextBlock>
                                    </AxisLabel>
                                    <Items>
                                        <telerik:ChartAxisItem Value="1">
                                            <TextBlock Text="BREST          ">
                                            </TextBlock>
                                        </telerik:ChartAxisItem>
                                        <telerik:ChartAxisItem Value="2">
                                            <TextBlock Text="BRIEUC         ">
                                            </TextBlock>
                                        </telerik:ChartAxisItem>
                                        <telerik:ChartAxisItem Value="3">
                                            <TextBlock Text="QUIMPER        ">
                                            </TextBlock>
                                        </telerik:ChartAxisItem>
                                        <telerik:ChartAxisItem Value="4">
                                            <TextBlock Text="VANNES         ">
                                            </TextBlock>
                                        </telerik:ChartAxisItem>
                                    </Items>
                                </XAxis>
                                <YAxis>
                                    <Appearance Color="134, 134, 134" MajorTick-Color="134, 134, 134" 
                                        MinorTick-Color="134, 134, 134" MinorTick-Width="0">
                                        <MajorGridLines Color="209, 222, 227" />
                                        <MinorGridLines Color="233, 239, 241" />
                                        <TextAppearance TextProperties-Color="51, 51, 51">
                                        </TextAppearance>
                                    </Appearance>
                                    <AxisLabel>
                                        <TextBlock>
                                            <Appearance TextProperties-Color="51, 51, 51">
                                            </Appearance>
                                        </TextBlock>
                                    </AxisLabel>
                                </YAxis>
                                <Appearance>
                                    <FillStyle FillType="Solid" MainColor="White">
                                    </FillStyle>
                                    <Border Color="134, 134, 134" />
                                </Appearance>
                            </PlotArea>
                            <Appearance Corners="Round, Round, Round, Round, 6">
                                <FillStyle FillType="Image">
                                    <FillSettings BackgroundImage="{chart}" ImageDrawMode="Flip" ImageFlip="FlipX">
                                    </FillSettings>
                                </FillStyle>
                                <Border Color="138, 138, 138" />
                            </Appearance>
                            <ChartTitle>
                                <Appearance Position-AlignedPosition="Top">
                                    <FillStyle MainColor="">
                                    </FillStyle>
                                </Appearance>
                                <TextBlock Text="Point Parc � 7 jours">
                                    <Appearance TextProperties-Font="Tahoma, 13pt">
                                    </Appearance>
                                </TextBlock>
                            </ChartTitle>
                            <Legend>
                                <Appearance Dimensions-Margins="15%, 3%, 1px, 1px" 
                                    Position-AlignedPosition="TopRight">
                                    <ItemMarkerAppearance Figure="Square">
                                        <Border Color="134, 134, 134" />
                                    </ItemMarkerAppearance>
                                    <FillStyle MainColor="">
                                    </FillStyle>
                                    <Border Color="Transparent" />
                                </Appearance>
                            </Legend>
                        </telerik:RadChart>
Johnny
Top achievements
Rank 3
Bronze
Iron
Iron
 answered on 19 Aug 2022
0 answers
242 views
I have a PanelBar that is tied to a sql server stored procedure. In my stored procedure, I am working out the users who should see certain panel items, so I have a field called "Item_Visible". Is there a way to get each item to pull from what I am returning in my stored procedure are mark the items visibility based on that field? 
Angela
Top achievements
Rank 1
Iron
 asked on 18 Aug 2022
1 answer
213 views

I am using a custom provider for file explorer control that gets folders from a database. The folders number in the 40 000s. I am facing the problem of now the page taking too long to load because the file explorer is trying to get the subfolders  for the 40000 something folders in the root directory in the the ResolveRootDirectoryAsTree Method. The page now takes hours to load.


 Public Overrides Function ResolveRootDirectoryAsTree(ByVal path As String) As DirectoryItem
        Dim directory As DirectoryItem = dataServer.GetDirectoryItem(path, True)

        If directory Is Nothing Then
            Return Nothing
        End If
        directory.Permissions = GetPermissions(path)

        If directory.Directories IsNot Nothing Then
            For Each dir As DirectoryItem In directory.Directories
                dir.Permissions = GetPermissions(path)
            Next
        End If

        Return directory
    End Function


 


Public Function GetDirectoryItem(ByVal path As String, ByVal includeSubfolders As Boolean) As DirectoryItem
        Dim item As DataRow = Me.GetItemRowFromPath(path)

        Return If(item IsNot Nothing, Me.CreateDirectoryItem(item, includeSubfolders), Nothing)
    End Function

    Private Function CreateDirectoryItem(ByVal item As DataRow, ByVal includeSubfolders As Boolean) As DirectoryItem
        'correct permissions should be applied from the content provider
        Dim directory As New DirectoryItem(item("Description").ToString(), Me.GetLoaction(item), Me.GetFullPath(item), [String].Empty, PathPermissions.Read, Nothing,
         Nothing)
        directory.Attributes.Add("CategoryID", item("CategoryID"))

        If includeSubfolders Then
            Dim subDirItems As DataRow() = GetChildDirectories(item)
            Dim subDirs As New List(Of DirectoryItem)()

            For Each subDir As DataRow In subDirItems
                subDirs.Add(CreateDirectoryItem(subDir, False))
            Next

            directory.Directories = subDirs.ToArray()
        Else
            directory.Directories = (New List(Of DirectoryItem)).ToArray()
        End If

        Return directory
    End Function

 

Is there a way to stop the initial load of the subfolders of the folders in the root folder and load them on demand? Or what can i do to make it more efficient in loading the too many folders?

 

Rumen
Telerik team
 answered on 18 Aug 2022
Narrow your results
Selected tags
Tags
+? more
Top users last month
Jay
Top achievements
Rank 3
Bronze
Iron
Iron
yw
Top achievements
Rank 2
Iron
Iron
Stefan
Top achievements
Rank 2
Iron
Iron
Iron
Kao Hung
Top achievements
Rank 1
Iron
Bohdan
Top achievements
Rank 2
Iron
Iron
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
Jay
Top achievements
Rank 3
Bronze
Iron
Iron
yw
Top achievements
Rank 2
Iron
Iron
Stefan
Top achievements
Rank 2
Iron
Iron
Iron
Kao Hung
Top achievements
Rank 1
Iron
Bohdan
Top achievements
Rank 2
Iron
Iron
Iron
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?