Telerik Forums
UI for ASP.NET AJAX Forum
2 answers
228 views
Hi Team,

Can we disable and Enable the Rad Grid Paging Buttons .

If I am In 1st page then we have to disable Previous and First buttons

similary If we are in last page then we have to diable Next and Last buttons

and

Can we show tool tips for Grid page index numbers 1,2,3................

please give ur advise as soon as possible ....

Regards,
Prasad
Prasad
Top achievements
Rank 1
 answered on 25 Oct 2012
1 answer
70 views
Dear
i need to save settings for grid but in same time i have my paging
 code :
public void CustomizedGridPagerSize(GridItemEventArgs e) {
        int allItemsCount = (e.Item as GridPagerItem).Paging.DataSourceCount;
        RadComboBox combo = (e.Item as GridPagerItem).FindControl("PageSizeComboBox") as RadComboBox;
        RadComboBoxItem item1 = new RadComboBoxItem("10", "10");
        RadComboBoxItem item2 = new RadComboBoxItem("20", "20");
        RadComboBoxItem item3 = new RadComboBoxItem("50", "50");
        RadComboBoxItem item4 = new RadComboBoxItem("100", "100");
        RadComboBoxItem item5 = new RadComboBoxItem("200", "200");
        RadComboBoxItem item6 = new RadComboBoxItem("All", allItemsCount.ToString());
        item1.Attributes.Add("ownerTableViewId", e.Item.OwnerTableView.ClientID);
        item2.Attributes.Add("ownerTableViewId", e.Item.OwnerTableView.ClientID);
        item3.Attributes.Add("ownerTableViewId", e.Item.OwnerTableView.ClientID);
        item4.Attributes.Add("ownerTableViewId", e.Item.OwnerTableView.ClientID);
        item5.Attributes.Add("ownerTableViewId", e.Item.OwnerTableView.ClientID);
        item6.Attributes.Add("ownerTableViewId", e.Item.OwnerTableView.ClientID);
        combo.Items.Clear();
        combo.Items.Add(item1);
        combo.Items.Add(item2);
        combo.Items.Add(item3);
        combo.Items.Add(item4);
        combo.Items.Add(item5);
        combo.Items.Add(item6);
        combo.Items.FindItemByValue(((RadGrid)e.Item.OwnerTableView.Parent).PageSize.ToString()).Selected = true;
    }

if we use the default paging sizes then it is working well and we can load the grid settings,
but when we use the code above to increase the paging sizes then when we load the grid settings we found the pager not saved

Regards
AhmedSalem
 
Angel Petrov
Telerik team
 answered on 25 Oct 2012
24 answers
621 views
Hi,
I'm long time Telerik controls user. I'm generally very hapy with them, but I miss one thing. Integrated RadTextBox property which set RadTextBox as Required. When you create long forms, you have two ways how to implement validation:
  • put and configure asp:RequiredFieldValidator to each RadTextBox. It is very painful work and you will end with very messy code
  • use RadInputManager with Validation IsRequired="true". This approach is good, but it's working only with classic TextBoxes, not with RadTextBoxes. And then I miss eg. possibility to define different EmptyMessage texts for each control.

My dream RadTextBox could be this one (meaning of new parameters is obvious):
<telerik:RadTextBox ID="RadTextBox1" Runat="server"  
EmptyMessage="Enter you desired username" 
Label="User Name" 
Required="True"  
RequiredMessage="Username is mandatory" 
ShowRedStar="True" 
MinLength="5"  
MinLengthMessage="Your username is too short" 
MaxLength="20" 
MaxLengthMessage="Use shorter username" 
Regex="[a-zA-Z0-9]" 
RegexMessage="Please use only alphabet and numbers" 
> 
</telerik:RadTextBox> 

I'm not developing wheel for now, those parameters are used in this ExJS implementation:
http://extasp.net/#/form/form_validate.aspx
Their TextBox works absolutly amazing. When non-valid, it sets itself into red, displays explanation bubble etc...

I'm able to achieve this behavior with RadTextBox also, but it will cost a lot of Javascript, implementation of RadToolTip etc. And I'm talking about speed! R.A.D.! :-) I just want to put required="true" into RadTextBox tag and everything is set.

Is there some way how to work with RadTextBox (...RadNumericTextBox, RadMaskedTextBox...) in simillar way?

Thank you very much for your advise.
Zdenek



Vasil
Telerik team
 answered on 25 Oct 2012
11 answers
1.7K+ views
How can I add a custom data attribute to a combo box that is dynamically created and bound to a DataTable?


protected
RadComboBox AddProductsCombo(int catID, int prodID)
   {
       RadComboBox RadComboBox1 = new RadComboBox();
       RadComboBox1.ID = "RadComboBox1";
       RadComboBox1.AutoPostBack = true;
       RadComboBox1.SelectedIndexChanged += new RadComboBoxSelectedIndexChangedEventHandler(RadComboBox1_SelectedIndexChanged);
       PlaceHolder1.Controls.Add(RadComboBox1);
 
       MySqlConnection conn = new MySqlConnection(ConfigurationManager.ConnectionStrings["MySQLConn"].ConnectionString);
       conn.Open();
       string sqlSelect1 = "SELECT p.prodID AS Id, p.prodName As Name, tsp.siteproductTypeID As Attr, p.catID  FROM products AS p INNER JOIN tblsiteproducts AS tsp ON tsp.prodID = p.prodID WHERE tsp.isActive = 1 AND tsp.siteID = 1 AND p.catID = ?catID AND isAddon = 0 ORDER BY prodSort ASC";
       MySqlDataAdapter adapter1 = new MySqlDataAdapter();
       MySqlCommand cmd1 = new MySqlCommand(sqlSelect1, conn);
       adapter1.SelectCommand = cmd1;
       cmd1.Parameters.Add("?catID", MySqlDbType.Int32).Value = catID;
 
       DataTable dt1 = new DataTable();
       adapter1.Fill(dt1);
 
       RadComboBox1.DataTextField = "Name";
       RadComboBox1.DataValueField = "Id";
       RadComboBox1.DataSource = dt1;
       RadComboBox1.DataBind();
       RadComboBox1.SelectedValue = prodID.ToString();
 
       return RadComboBox1;
   }
Nencho
Telerik team
 answered on 25 Oct 2012
3 answers
96 views
I'm missing the old classic interface for ASP.NET AJAX demos. In the new one some code is missing and cant find the links to community and support, Why have you changed something that it was just fine? Perhaps is to implement that green-black amazing color combination?  :-P

Joaquín
Iana Tsolova
Telerik team
 answered on 25 Oct 2012
1 answer
71 views
Unfortunately, I couldn't find any demo or documentation regarding using CommandItem row. There are some demos using the CommandItem but focusing on other features so no explanation how to use it.
So what would be the condition(s) to make the CommandItem row visible with the built-in grid command options, e.g. Refresh, export ?

I tried the code below but it didn't work:
<CommandItemSettings ExportToPdfText="Export to PDF"
ShowRefreshButton="True"
ShowAddNewRecordButton="True"
ShowExportToPdfButton="True"
ShowExportToExcelButton="True"
ShowExportToWordButton="True">
</
CommandItemSettings>

miksh
Top achievements
Rank 1
Iron
 answered on 25 Oct 2012
3 answers
152 views
Hi,

since the new update my GridTemplateColumn have a bad rendering. See the image below.

RadGrid:

<telerik:RadGrid ID="gridMPA" runat="server" CellSpacing="0" BorderWidth="0" GridLines="None">
    <FilterMenu EnableImageSprites="False">
    </FilterMenu>
    <ClientSettings>
        <Selecting CellSelectionMode="None"></Selecting>
    </ClientSettings>
    <MasterTableView DataKeyNames="Noauto" EditMode="InPlace">
        <CommandItemSettings ExportToPdfText="Export to PDF"></CommandItemSettings>
        <RowIndicatorColumn Visible="True" FilterControlAltText="Filter RowIndicator column">
            <HeaderStyle Width="20px"></HeaderStyle>
        </RowIndicatorColumn>
        <ExpandCollapseColumn Visible="True" FilterControlAltText="Filter ExpandColumn column">
            <HeaderStyle Width="20px"></HeaderStyle>
        </ExpandCollapseColumn>
        <Columns>
            <telerik:GridBoundColumn AutoPostBackOnFilter="true" FilterControlAltText="Filter colNoAuto column"
                HeaderText="NoAuto" UniqueName="colNoAuto" ShowFilterIcon="false" Visible="false"
                DataField="Noauto" ReadOnly="true">
            </telerik:GridBoundColumn>
            <telerik:GridBoundColumn AutoPostBackOnFilter="true" FilterControlAltText="Filter colNumero column"
                HeaderText="Numero" UniqueName="colNumero" ShowFilterIcon="false" DataField="Numero"
                ReadOnly="true">
            </telerik:GridBoundColumn>
            <telerik:GridBoundColumn AutoPostBackOnFilter="true" FilterControlAltText="Filter colMedicament column"
                HeaderText="Médicament" UniqueName="colMedicament" ShowFilterIcon="false" DataField="NomMedicament"
                ReadOnly="true">
                <HeaderStyle Width="200px" />
                <ItemStyle Wrap="false" />
            </telerik:GridBoundColumn>
            <telerik:GridBoundColumn AutoPostBackOnFilter="true" FilterControlAltText="Filter colDose column"
                HeaderText="Dose" UniqueName="colDose" ShowFilterIcon="false" DataField="Dose"
                ReadOnly="true">
                <ItemStyle Wrap="false" />
            </telerik:GridBoundColumn>
            <telerik:GridBoundColumn AutoPostBackOnFilter="true" FilterControlAltText="Filter colPosologie column"
                HeaderText="Posologie" UniqueName="colPosologie" ShowFilterIcon="false" DataField="Posologie"
                ReadOnly="true">
                <ItemStyle Wrap="false" />
            </telerik:GridBoundColumn>
            <telerik:GridBoundColumn AutoPostBackOnFilter="true" FilterControlAltText="Filter colAHFS column"
                HeaderText="Code A.H.F.S." UniqueName="colAHFS" ShowFilterIcon="false" DataField="AHFS"
                ReadOnly="true">
                <ItemStyle Wrap="false" />
            </telerik:GridBoundColumn>
            <telerik:GridImageColumn UniqueName="colMPA" HeaderText="MPA" ImageUrl="~/Images/empty.png"
                ShowFilterIcon="false" AllowFiltering="false">
                <HeaderStyle HorizontalAlign="Center"></HeaderStyle>
                <ItemStyle HorizontalAlign="Center"></ItemStyle>
            </telerik:GridImageColumn>
            <telerik:GridImageColumn UniqueName="colDivergence" HeaderText="Divergence" ImageUrl="~/Images/empty.png"
                ShowFilterIcon="false" AllowFiltering="false">
                <HeaderStyle HorizontalAlign="Center"></HeaderStyle>
                <ItemStyle HorizontalAlign="Center"></ItemStyle>
            </telerik:GridImageColumn>
            <telerik:GridButtonColumn ButtonType="ImageButton" UniqueName="colSub" HeaderText="Sub."
                CommandName="SelectSub" ImageUrl="~/Images/empty.png">
                <HeaderStyle HorizontalAlign="Center"></HeaderStyle>
                <ItemStyle HorizontalAlign="Center"></ItemStyle>
            </telerik:GridButtonColumn>
            <telerik:GridButtonColumn ButtonType="ImageButton" UniqueName="colTest" HeaderText="Test"
                CommandName="AddDivergence" ImageUrl="~/Images/empty.png">
                <HeaderStyle HorizontalAlign="Center"></HeaderStyle>
                <ItemStyle HorizontalAlign="Center"></ItemStyle>
            </telerik:GridButtonColumn>
            <telerik:GridTemplateColumn UniqueName="colCesser" InitializeTemplatesFirst="false"
                ReadOnly="true" ShowFilterIcon="false">
                <HeaderTemplate>
                    <div class="center">
                        <telerik:RadCodeBlock runat="server">
                            <%=GetMessageEx(5220).Texte%>
                        </telerik:RadCodeBlock>
                    </div>
                    <div class="center">
                        <telerik:RadButton ID="colCesser_chk_header" runat="server" ButtonType="ToggleButton" CausesValidation="false"
                            ToggleType="CheckBox" AutoPostBack="true" OnCheckedChanged="chkHeader_CheckedChanged">
                        </telerik:RadButton>
                    </div>
                </HeaderTemplate>
                <ItemTemplate>
                    <div class="center">
                        <telerik:RadButton ID="colCesser_chk_item" runat="server" ButtonType="ToggleButton" CausesValidation="false"
                            ToggleType="CheckBox" AutoPostBack="true" Checked='<%# Eval("Cesser") %>' OnCheckedChanged="chkCesser_CheckedChanged">
                        </telerik:RadButton>
                    </div>
                </ItemTemplate>
            </telerik:GridTemplateColumn>
            <telerik:GridTemplateColumn UniqueName="colContinuer" InitializeTemplatesFirst="false"
                ReadOnly="true" ShowFilterIcon="false">
                <HeaderTemplate>
                    <div class="center">
                        <telerik:RadCodeBlock runat="server">
                            <%=GetMessageEx(1214).Texte%>
                        </telerik:RadCodeBlock>
                    </div>
                    <div class="center">
                        <telerik:RadButton ID="colContinuer_chk_header" runat="server" ButtonType="ToggleButton" CausesValidation="false"
                            ToggleType="CheckBox" AutoPostBack="true" OnCheckedChanged="chkHeader_CheckedChanged">
                        </telerik:RadButton>
                    </div>
                </HeaderTemplate>
                <ItemTemplate>
                    <div class="center">
                        <telerik:RadButton ID="colContinuer_chk_item" runat="server" ButtonType="ToggleButton" CausesValidation="false"
                            ToggleType="CheckBox" AutoPostBack="true" Checked='<%# Eval("Continuer") %>'
                            OnCheckedChanged="chkContinuer_CheckedChanged">
                        </telerik:RadButton>
                    </div>
                </ItemTemplate>
                <HeaderStyle Wrap="false" />
            </telerik:GridTemplateColumn>
            <telerik:GridTemplateColumn UniqueName="colModifier" InitializeTemplatesFirst="false"
                ReadOnly="true" ShowFilterIcon="false">
                <HeaderTemplate>
                    <div class="center">
                        <telerik:RadCodeBlock runat="server">
                            <%=GetMessageEx(1042).Texte%>
                        </telerik:RadCodeBlock>
                    </div>
                    <div class="center">
                        <telerik:RadButton ID="colModifier_chk_header" runat="server" ButtonType="ToggleButton" CausesValidation="false"
                            ToggleType="CheckBox" AutoPostBack="true" OnCheckedChanged="chkHeader_CheckedChanged">
                        </telerik:RadButton>
                    </div>
                </HeaderTemplate>
                <ItemTemplate>
                    <div class="center">
                        <telerik:RadButton ID="colModifier_chk_item" runat="server" ButtonType="ToggleButton" CausesValidation="false"
                            ToggleType="CheckBox" AutoPostBack="true" Checked='<%# Eval("Modifier") %>' OnCheckedChanged="chkModifier_CheckedChanged">
                        </telerik:RadButton>
                    </div>
                </ItemTemplate>
            </telerik:GridTemplateColumn>
            <telerik:GridEditCommandColumn FilterControlAltText="Filter EditCommandColumn column"
                ButtonType="ImageButton" EditText="Modifier" Resizable="False" EditImageUrl="Images/Icons/006-Write-New-Icon.png"
                UniqueName="colEdit">
                <HeaderStyle Width="32px"></HeaderStyle>
                <ItemStyle Width="32px" />
            </telerik:GridEditCommandColumn>
            <telerik:GridTemplateColumn UniqueName="colQte" InitializeTemplatesFirst="false"
                ShowFilterIcon="false">
                <HeaderTemplate>
                    <div class="center">
                        <telerik:RadButton ID="colQte_btn_header" runat="server" ButtonType="StandardButton" CausesValidation="false"
                            AutoPostBack="false" OnClientClicked="openQteFillWindow" OnLoad="btnRemplir_Load">
                        </telerik:RadButton>
                    </div>
                </HeaderTemplate>
                <ItemTemplate>
                    <div class="center">
                        <%#Eval("Quantite")%>
                    </div>
                </ItemTemplate>
                <EditItemTemplate>
                    <div class="center">
                        <telerik:RadNumericTextBox runat="server" ID="colQte_txt_edit" MinValue="0" MaxLength="4"
                            Width="50px" DbValue='<%#Bind("Quantite")%>'>
                        </telerik:RadNumericTextBox>
                    </div>
                </EditItemTemplate>
            </telerik:GridTemplateColumn>
            <telerik:GridTemplateColumn UniqueName="colRen" InitializeTemplatesFirst="false"
                ShowFilterIcon="false">
                <HeaderTemplate>
                    <div class="center">
                        <telerik:RadButton ID="colRen_btn_header" runat="server" ButtonType="StandardButton"
                            AutoPostBack="false" OnClientClicked="openRenFillWindow" OnLoad="btnRemplir_Load">
                        </telerik:RadButton>
                    </div>
                </HeaderTemplate>
                <ItemTemplate>
                    <div class="center">
                        <%#Eval("Renouvellements")%>
                    </div>
                </ItemTemplate>
                <EditItemTemplate>
                    <div class="center">
                        <telerik:RadNumericTextBox runat="server" ID="colRen_txt_edit" MinValue="0" MaxLength="4"
                            Width="50px" DbValue='<%#Bind("Renouvellements")%>'>
                        </telerik:RadNumericTextBox>
                    </div>
                </EditItemTemplate>
            </telerik:GridTemplateColumn>
            <telerik:GridBoundColumn AutoPostBackOnFilter="true" FilterControlAltText="Filter colRaison column"
                HeaderText="Raison" UniqueName="colRaison" ShowFilterIcon="false" DataField="Commentaire">
                <HeaderStyle Width="220px" />
            </telerik:GridBoundColumn>
        </Columns>
        <EditFormSettings>
            <EditColumn FilterControlAltText="Filter EditCommandColumn column">
            </EditColumn>
        </EditFormSettings>
        <SortExpressions>
            <telerik:GridSortExpression FieldName="Numero" SortOrder="Ascending" />
        </SortExpressions>
    </MasterTableView>
    <ClientSettings AllowKeyboardNavigation="true">
        <ClientEvents OnCommand="gridMPA_OnCommand" />
        <KeyboardNavigationSettings AllowSubmitOnEnter="true" />
        <Resizing EnableRealTimeResize="true" />
    </ClientSettings>
</telerik:RadGrid>

Thanks
Angel Petrov
Telerik team
 answered on 25 Oct 2012
3 answers
72 views
I have appointments that start on the 21st and end on the 23rd but the timeline only shows the appointment on the 21st which is misleading. Is there a setting for the timeline that will make this happen. I tried ExactTimeRendering and that didn't do it and I can't really use that one anyway.
Plamen
Telerik team
 answered on 25 Oct 2012
1 answer
107 views
In our CMS I use the ResolveDirectory override to create custom resized thumbnails in the FileExplorer's ListView.

It is a problem when the folder contains lots of files (sometimes > 5000), these files are all resized directly on the first page.
How would I create a function which resizes only the files which are on the current page?
I tried to use the GetFile override but to no avail, this one doesn't seem to be triggered when browsing the files.

Any suggestions?

Marc

Vessy
Telerik team
 answered on 25 Oct 2012
0 answers
74 views
Hello there,

Just to let you know that I used two telerik image button with toggle images for the "hover effect" and I just realized that the images don't work from mobile devices (a nokia Lumnia 800, the same for iPhone).
The actual result is that images get rendered but buttons don't do anything. The page keeps loading forevers.

Thanks,
javier
Top achievements
Rank 1
 asked on 25 Oct 2012
Narrow your results
Selected tags
Tags
+? more
Top users last month
Tien
Top achievements
Rank 1
Iron
Krasimir
Top achievements
Rank 3
Bronze
Iron
Iron
Cedar
Top achievements
Rank 1
Iron
Emil
Top achievements
Rank 1
Iron
Kyle Watson
Top achievements
Rank 1
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
Tien
Top achievements
Rank 1
Iron
Krasimir
Top achievements
Rank 3
Bronze
Iron
Iron
Cedar
Top achievements
Rank 1
Iron
Emil
Top achievements
Rank 1
Iron
Kyle Watson
Top achievements
Rank 1
Iron
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?