Telerik Forums
UI for ASP.NET AJAX Forum
3 answers
288 views
Hi gentlemans,

Here is my aspx code:
<telerik:GridTemplateColumn DataField="DA_RESLN" HeaderText="Date de résolution" UniqueName="DA_RESLN" SortExpression="DA_RESLN"
ShowFilterIcon="True" HeaderStyle-Width="120px" FilterControlWidth="100px"
AutoPostBackOnFilter="True" FilterDelay="2000">
    <ItemTemplate>
        <asp:Label ID="LabelDateResolution" Text='<%#Eval("DA_RESLN", "{0:yyyy-MM-dd}")%>' runat="server"></asp:Label>
    </ItemTemplate>
    <EditItemTemplate>
        <telerik:RadDatePicker runat="server" ID="DatePickerDateResolution" SelectedDate='<%#Eval("DA_RESLN")%>' Calendar-Visible="True" ></telerik:RadDatePicker>
        <asp:CustomValidator ID="DatePickerDateResolution_Validator" runat="server" ErrorMessage="*Obligatoire" Display="Dynamic" ValidateEmptyText="True" ControlToValidate="DatePickerDateResolution" OnServerValidate="dtePickerDaReslnValidator_ServerValidate"></asp:CustomValidator>
    </EditItemTemplate>
</telerik:GridTemplateColumn>

I must be missing something here because the filter is rendered correctly and works perfectly except that it dosent show the calendar at right of the inputbox just like a GridDateTimeColumn does. Anyone ??

Thanks in advance,
Eyup
Telerik team
 answered on 09 Jun 2014
1 answer
156 views
I am using radmultipage for a wizard.
I have a grid on one of the tabs.

My grid has a lot of spacing/padding when it renders. The grids on separate pages look fine, they just look broken inside a tabstrip.
Also my combobox images do not load properly in edit mode.

I have attached images for both.

Below is my grid declaration:

<telerik:RadGrid ID="rgContingentBeneficiary" runat="server" OnNeedDataSource="rgContingentBeneficiary_NeedDataSource"
    OnInsertCommand="rgContingentBeneficiary_InsertCommand" OnUpdateCommand="rgContingentBeneficiary_UpdateCommand"
    OnItemCreated="rgContingentBeneficiary_ItemCreated" OnDeleteCommand="rgContingentBeneficiary_DeleteCommand"
    OnItemDataBound="rgContingentBeneficiary_ItemDataBound">
    <MasterTableView Width="750px" CommandItemDisplay="Bottom" EditMode="EditForms" DataKeyNames="BeneficiaryID,BeneficiaryPercent">
        <CommandItemSettings ShowRefreshButton="false" ShowExportToExcelButton="false" ShowExportToPdfButton="false"
            ShowExportToWordButton="false" ShowExportToCsvButton="false" ShowAddNewRecordButton="true"
            AddNewRecordText="Add New Beneficiary" />
        <Columns>
            <telerik:GridBoundColumn DataField="BeneficiaryID" UniqueName="BeneficiaryID" Display="false">
            </telerik:GridBoundColumn>
            <telerik:GridTemplateColumn HeaderText="Full Name" SortExpression="Beneficiary" UniqueName="Beneficiary"
                ItemStyle-HorizontalAlign="Left" HeaderStyle-HorizontalAlign="Left" HeaderStyle-Width="44%"
                ItemStyle-Wrap="true">
                <ItemTemplate>
                    <%# Eval("Beneficiary")%>
                </ItemTemplate>
            </telerik:GridTemplateColumn>
            <telerik:GridTemplateColumn HeaderText="Relationship" SortExpression="BeneficiaryRelationship"
                ItemStyle-HorizontalAlign="Left" HeaderStyle-HorizontalAlign="Left" HeaderStyle-Width="30%"
                UniqueName="BeneficiaryRelationship">
                <ItemTemplate>
                    <%# Eval("BeneficiaryRelationship")%>
                </ItemTemplate>
            </telerik:GridTemplateColumn>
            <telerik:GridTemplateColumn HeaderText="Percentage" SortExpression="BeneficiaryPercentage"
                HeaderStyle-Width="20%" UniqueName="BeneficiaryPercentage">
                <ItemTemplate>
                    <telerik:RadNumericTextBox ID="txtBeneficiaryPercentage" runat="server" DbValue='<%# Eval("BeneficiaryPercentage") %>'
                        Type="Percent" BorderStyle="None" BackColor="Transparent" NumberFormat-DecimalDigits="1">
                        <ClientEvents OnBlur="Blur" OnFocus="Focus" />
                    </telerik:RadNumericTextBox>
                </ItemTemplate>
                <FooterTemplate>
                    <telerik:RadTextBox ID="txtFooterTotal" runat="server" BorderStyle="None" BackColor="Transparent">
                        <ClientEvents OnLoad="Load" />
                    </telerik:RadTextBox>
                </FooterTemplate>
            </telerik:GridTemplateColumn>
            <telerik:GridEditCommandColumn ButtonType="ImageButton" EditText="Edit" CancelText="Cancel"
                HeaderStyle-Width="3%" UniqueName="EditCommandColumn">
                <ItemStyle />
            </telerik:GridEditCommandColumn>
            <telerik:GridButtonColumn ButtonType="ImageButton" ConfirmText="Delete this Beneficiary?"
                HeaderStyle-Width="3%" CommandName="Delete" Text="Delete" UniqueName="DeleteColumn">
                <ItemStyle HorizontalAlign="Center" />
            </telerik:GridButtonColumn>
        </Columns>
        <EditFormSettings EditFormType="Template">
            <PopUpSettings Modal="false" Width="650px" />
            <EditColumn UniqueName="EditCommandColumn">
            </EditColumn>
            <FormTemplate>
                <fieldset>
                    <legend><b>Current Designation</b></legend>
                    <table width="650px">
                        <tr>
                            <td colspan="6">
                                <asp:ValidationSummary ID="ValidationSummary1" runat="server" EnableClientScript="true"
                                    DisplayMode="List" HeaderText="Please correct the errors below:" />
                            </td>
                        </tr>
                        <tr>
                            <td>
                                  
                            </td>
                            <td>
                                <asp:Label ID="Label1" runat="server" Text="Full Name:"></asp:Label>
                            </td>
                            <td>
                                <telerik:RadTextBox ID="txtFullName" runat="server" Width="150px" Text='<%# Eval("Beneficiary")%>'>
                                    <ReadOnlyStyle ForeColor="DarkGray" />
                                </telerik:RadTextBox>
                                <asp:RequiredFieldValidator ID="reqFullName" runat="server" ControlToValidate="txtFullName"
                                    Text="*" ErrorMessage="* Beneficiary Name is required"></asp:RequiredFieldValidator>
                            </td>
                            <td>
                                  
                            </td>
                            <td>
                                <asp:Label ID="Label3" runat="server" Text="Address 1:"></asp:Label>
                            </td>
                            <td>
                                <telerik:RadTextBox ID="txtAddress1" runat="server" Width="150px" Text='<%# Eval("Address1")%>'>
                                </telerik:RadTextBox>
                            </td>
                        </tr>
                        <tr>
                            <td>
                                  
                            </td>
                            <td>
                                <asp:Label ID="Label8" runat="server" Text="Relationship:"></asp:Label>
                            </td>
                            <td>
                                <telerik:RadComboBox ID="ddlRelationship" runat="server"  LoadingMessage="Loading Relationship..."
                                    DataSourceID="_dataSrcRelationship" DataTextField="BeneficiaryRelationship" DataValueField="BeneficiaryRelationship"
                                    MarkFirstMatch="True" ToolTip="Select a Relationship" AllowCustomText="false"
                                    Width="150px">
                                </telerik:RadComboBox>
                                <asp:RequiredFieldValidator ID="reqRelationship" runat="server" ControlToValidate="ddlRelationship"
                                    Text="*" ErrorMessage="* Relation Type is required"></asp:RequiredFieldValidator>
                            </td>
                            <td>
                                  
                            </td>
                            <td>
                                <asp:Label ID="Label10" runat="server" Text="Address 2:"></asp:Label>
                            </td>
                            <td>
                                <telerik:RadTextBox ID="txtAddress2" runat="server" Width="150px" Text='<%# Eval("Address2")%>'>
                                </telerik:RadTextBox>
                            </td>
                        </tr>
                        <tr>
                            <td>
                                  
                            </td>
                            <td>
                                <asp:Label ID="Label7" runat="server" Text="Percentage:"></asp:Label>
                            </td>
                            <td>
                                <telerik:RadNumericTextBox ID="txtPercentage" Width="150px" runat="server" Text='<%# Eval("BeneficiaryPercentage") %>'
                                    MinValue="0" MaxValue="100" MaxLength="4">
                                    <NumberFormat DecimalDigits="1" />
                                </telerik:RadNumericTextBox>
                                  
                                <asp:RequiredFieldValidator ID="reqPercentage" runat="server" ControlToValidate="txtPercentage"
                                    Text="*" ErrorMessage="* Percentage is required"></asp:RequiredFieldValidator>
                            </td>
                            <td>
                                  
                            </td>
                            <td>
                                <asp:Label ID="Label4" runat="server" Text="City:"></asp:Label>
                            </td>
                            <td>
                                <telerik:RadTextBox ID="txtCity" runat="server" Width="150px" Text='<%# Eval("City")%>'>
                                </telerik:RadTextBox>
                            </td>
                        </tr>
                        <tr>
                            <td>
                                  
                            </td>
                            <td>
                                <asp:Label ID="Label2" runat="server" Text="Birth Date/Trust Date:"></asp:Label>
                            </td>
                            <td>
                                <telerik:RadDatePicker ID="rdpBirthDate" runat="server" Width="150px" DbSelectedDate='<%# Eval("BeneficiaryBirthDate")%>'
                                    MinDate="1/1/1900">
                                    <ClientEvents OnDateSelected="OnDateSelected" />
                                    <DateInput ID="DateInput1" runat="server">
                                        <ClientEvents OnError="onDateError" OnBlur="onBlur" />
                                    </DateInput>
                                </telerik:RadDatePicker>
                                <asp:CustomValidator runat="server" ID="cvBirthDate" ClientValidationFunction="CustomValidate"
                                    Text="*" ErrorMessage="* Date should be valid and less than today's date." />
                            </td>
                            <td>
                                  
                            </td>
                            <td>
                                <asp:Label ID="Label5" runat="server" Text="State:"></asp:Label>
                            </td>
                            <td>
                                <telerik:RadComboBox ID="ddlState" runat="server"  LoadingMessage="Loading State..."
                                    DataSourceID="_dataSrcStateList" DataTextField="StateCode" DataValueField="StateCode"
                                    MarkFirstMatch="False" ToolTip="Select a State" AllowCustomText="false" Width="100px">
                                </telerik:RadComboBox>
                            </td>
                        </tr>
                        <tr>
                            <td>
                                  
                            </td>
                            <td>
                                <asp:Label ID="Label9" runat="server" Text="SSN/Tax ID:"></asp:Label>
                            </td>
                            <td>
                                <telerik:RadTextBox ID="txtBeneficiarySsn" runat="server" Width="150px" Text='<%# Eval("BeneficiarySsn")%>'>
                                </telerik:RadTextBox>
                            </td>
                            <td>
                                  
                            </td>
                            <td>
                                <asp:Label ID="Label6" runat="server" Text="Postal Code:"></asp:Label>
                            </td>
                            <td>
                                <telerik:RadNumericTextBox ID="txtPostalCode" Width="150px" runat="server" Text='<%# Bind("PostalCode") %>'
                                    MinValue="00001" MaxValue="99999">
                                    <NumberFormat DecimalDigits="0" GroupSizes="5" />
                                </telerik:RadNumericTextBox>
                            </td>
                        </tr>
                        <tr>
                            <td colspan="4">
                                  
                            </td>
                            <td>
                                <asp:Label ID="Label12" runat="server" Text="Country:"></asp:Label>
                            </td>
                            <td>
                                <telerik:RadTextBox ID="txtCountry" runat="server" Width="150px" Text='<%# Eval("Country")%>'>
                                </telerik:RadTextBox>
                            </td>
                        </tr>
                        <tr>
                            <td colspan="6" style="text-align: center">
                                <br />
                            </td>
                        </tr>
                        <tr>
                            <td colspan="5" style="text-align: left">
                                  
                            </td>
                            <td style="text-align: left">
                                <telerik:RadButton ID="btnUpdate" runat="server" Text="OK" CommandArgument="Update record"
                                    CommandName='<%# ((bool)DataBinder.Eval(Container, "OwnerTableView.IsItemInserted")) ? "PerformInsert" : "Update" %>'>
                                    <Icon PrimaryIconUrl="../../App_Themes/Images/rbOk.jpg" PrimaryIconLeft="5"
                                        PrimaryIconTop="4"></Icon>
                                </telerik:RadButton>
                                  
                                <telerik:RadButton runat="server" ID="btnCancel" CommandName="Cancel" CommandArgument="Cancel Edit"
                                    Text="Cancel" CausesValidation="false">
                                    <Icon PrimaryIconUrl="../../App_Themes/Images/rbCancel.jpg" PrimaryIconLeft="5"
                                        PrimaryIconTop="4"></Icon>
                                </telerik:RadButton>
                            </td>
                        </tr>
                        <tr>
                            <td colspan="6" style="text-align: center">
                                <br />
                            </td>
                        </tr>
                    </table>
                </fieldset>
            </FormTemplate>
        </EditFormSettings>
    </MasterTableView>
</telerik:RadGrid>

Venelin
Telerik team
 answered on 09 Jun 2014
1 answer
223 views
I've Two tabs, First tab where I've defined class = "k-state-active". In 2nd tab, i've few buttons & Grid. Based on button click I need Grid (in the 2nd tab) to be populated (server side) after the postback. I've below JQuery to show 2nd tab after postback which is not working.


$(function () {
   $('Button').click(function () {
       var tabstrip = $("#tabstrip").kendoTabStrip().data("kendoTabStrip");​​
       tabstrip.select(1);
    });
});

With above code, I'm getting first tab instead of 2nd tab after button click. Please help.
Alex Gyoshev
Telerik team
 answered on 09 Jun 2014
1 answer
87 views
<telerik:RadAjaxPanel ID="RadAjaxPanel1" runat="server">
 
 
           <telerik:RadGrid ID="radGridBooks" runat="server"
               AutoGenerateColumns="False"
               ShowFooter="True"
               CellSpacing="0"
               GridLines="None"
               Skin="Default"
               OnNeedDataSource="radGridBooks_NeedDataSource">
 
               <MasterTableView CommandItemDisplay="Top" EditMode="PopUp" GridLines="None" TableLayout="Fixed">
 
                   <CommandItemSettings AddNewRecordText="Add New Book" RefreshText="Refresh"></CommandItemSettings>
                   <Columns>
 
                       <telerik:GridEditCommandColumn></telerik:GridEditCommandColumn>
                       <telerik:GridBoundColumn DataField="ID" UniqueName="ID" HeaderText="Book ID"></telerik:GridBoundColumn>
                       <telerik:GridBoundColumn DataField="Name" HeaderText="Book Name">
                           <ColumnValidationSettings EnableRequiredFieldValidation="true" EnableModelErrorMessageValidation="true">
                               <RequiredFieldValidator ForeColor="Red" ErrorMessage="Required"></RequiredFieldValidator>
                           </ColumnValidationSettings>
                       </telerik:GridBoundColumn>
                       <telerik:GridButtonColumn Text="Del" CommandName="DeleteBook" CommandArgument="ID"></telerik:GridButtonColumn>
                   </Columns>
                   <EditFormSettings EditFormType="Template" CaptionDataField="ID" PopUpSettings-ScrollBars="Auto" PopUpSettings-Modal="True" PopUpSettings-ShowCaptionInEditForm="true">
                       <FormTemplate>
                           <table width="100%">
                               <tr>
                                   <td>Try</td>
                               </tr>
                           </table>
                       </FormTemplate>
                   </EditFormSettings>
               </MasterTableView>
               <ClientSettings EnableRowHoverStyle="true">
               </ClientSettings>
           </telerik:RadGrid>
 
       </telerik:RadAjaxPanel>



LOOK THIS PHOTO
Princy
Top achievements
Rank 2
 answered on 09 Jun 2014
1 answer
210 views
Hi Sir,

I put the Grid on the usercontrol, I have to set the usercontrol enabledviewstate="false", the problem is now the  OnItemCommand="MyGrid_ItemCommand" not fired or not triggered, that means when I click 'Edit' or other commandbutton ,nothing happen, If I set the enabledviewstate = 'true' for the usercontrol, everything works fine, but I need to disable the viewstate for whole usercontrol,  do you have some suggetions about this issue? how can I trigger/fire the OnItemCommand event when whole usercontrol  'EnableViewState'  is false.
Thanks

Regards

Princy
Top achievements
Rank 2
 answered on 09 Jun 2014
2 answers
279 views
I am in the process of changing from a GridView to a RadGrid and have been experiencing a few issues.

I am attempting to pull an "Active" token from my RadGrid that displays a lot of product information. I do not have the "Active" token being displayed to the user though. It is not set to a hidden value either. The token gets pulled when the user presses the Delete button inside a GridTemplateColumn on my RadGrid.

Before with the GridView, I could use System.Web.UI.DataBinder.Eval(e.Row.DataItem, "Active") and it would return whether or not the Active token was a 1 or a 0.

I currently have the following in VB.NET:

Protected Sub rgvMyGrid_RowCommand(ByVal sender As Object, ByVal e As Telerik.Web.UI.GridCommandEventArgs) Handles rgvMyGrid.ItemCommand
 
  If (e.CommandName = "DeleteMSDS") Then
    Dim myDelete As WinampButton = CType(e.Item.FindControl("btnDelete"), WinampButton)
    myDelete.CommandName = "DeleteMSDS"
    myDelete.CommandArgument = System.Web.UI.DataBinder.Eval(e.Item.DataItem, "MSDSID")
    If System.Web.UI.DataBinder.Eval(e.item.DataItem, "Active")
      myDelete.Attributes.Add("onClick", "javascript:return confirm('Are you sure you want to permanently delete this SDS / MSDS?');")
    End If
  End If


Before this worked like a charm, but I am having trouble. I have noticed that the System.Web.UI.DataBinder(e.Item.DataItem, "MSDSID") never returns anything. And in turn, it cannot find an instance of "Active" being used then.
Alexander
Top achievements
Rank 1
 answered on 06 Jun 2014
2 answers
258 views

Hi,


I am using RadGrid for an webapplication that runs on touch screen
monitor. It becomes very difficult for the users to scroll using the
standard sized scroll bars that come up in radgrid. Can someone please
advice on how to increase the scroll bar width.

image attach below

thanks
Marin
Telerik team
 answered on 06 Jun 2014
1 answer
113 views
I am using the "NeedDataSource" method to fill in a grid.  On the ItemDataBound I am setting the background colors for some values in a couple of column cells.  (Sub below)

This displays properly.  Dragging columns around works properly and the colors follow the cells.  However, when you do a grouping by dragging the column to the top of the grid the colors do not stay with the cells.

I have attached a before and after image...

Any ideas why this is moving?   I am setting the colors based on the FindByUniqueName identifier for the column.

Thanks,
Nathan


Protected Sub rgDispatch_ItemDataBound(sender As Object, e As Telerik.Web.UI.GridItemEventArgs) Handles rgDispatch.ItemDataBound
    '//Is it a GridDataItem
    If Not IsNothing(TryCast(e.Item, Telerik.Web.UI.GridDataItem)) Then
        'Get the instance of the right type
        Dim dataBoundItem As Telerik.Web.UI.GridDataItem = DirectCast(e.Item, Telerik.Web.UI.GridDataItem)
        'Set the desired color on the Status column based on the value
        Dim StatusColIndex As Integer = rgDispatch.Columns.FindByUniqueName("Status").OrderIndex
        Select Case dataBoundItem("Status").Text
            Case "Loading"
                dataBoundItem("Status").BackColor = System.Drawing.Color.Yellow
            Case "Loaded"
                dataBoundItem("Status").BackColor = System.Drawing.Color.DodgerBlue
            Case "Claimed"
                dataBoundItem("Status").BackColor = System.Drawing.Color.Orange
            Case "Started"
                dataBoundItem("Status").BackColor = System.Drawing.Color.FromArgb(19, 229, 19)  'Green color
            Case "Stopped"
                dataBoundItem("Status").BackColor = System.Drawing.Color.IndianRed
        End Select
        'Set the desired color on the Status column based on the value
        Dim MatReadyColIndex As Integer = rgDispatch.Columns.FindByUniqueName("MatReady").OrderIndex
        Select Case dataBoundItem("MatReady").Text
            Case "Yes"
                e.Item.Cells(MatReadyColIndex).BackColor = System.Drawing.Color.FromArgb(19, 229, 19)
            Case "No"
                e.Item.Cells(MatReadyColIndex).BackColor = System.Drawing.Color.IndianRed
        End Select
    End If
    If Not IsNothing(TryCast(e.Item, Telerik.Web.UI.GridPagerItem)) Then
        Dim pager As Telerik.Web.UI.GridPagerItem = DirectCast(e.Item, Telerik.Web.UI.GridPagerItem)
        Dim PagerLabel As Label = pager.FindControl("ChangePageSizeLabel")
        PagerLabel.Text = "Items per Page"
    End If
End Sub
Nathan
Top achievements
Rank 1
 answered on 06 Jun 2014
1 answer
226 views
I have a grid with a hyperlink to a network folder.  The location is constructed in a query based on some information that SHOULD be correct, but there are mistakes made by the end-users and the hyperlink on occasion will be correct.  

<telerik:GridTemplateColumn ColumnGroupName="DLB" UniqueName="Location"  Display="True" HeaderText="Files" >
    <ItemTemplate>
        <a href="<%# Eval("Location")%>" target="_blank">Open folder</a>
    </ItemTemplate>
</telerik:GridTemplateColumn>

For each row, I would like to somehow handle that hyperlink if the network folder does not exist.  Either there will be no link to click or popup a message that informs the user the network folder does not exist.

I figure I would likely use System.IO.Directory.Exists, but I am clueless as to how to implement that.  I have made some attempts and searched for a solution, but have not come up with anything that works for me.

Thank you!
Eyup
Telerik team
 answered on 06 Jun 2014
2 answers
73 views
I have noticed a new behavior in the editor in IE while upgrading to the latest version (2014.1.403). If you add certain styles (width, height, float, maybe others) to a block element (div, p, h1, etc), you can no longer select text in that element with the mouse. You can select the element itself, which is displayed with a border and handles, but not the content inside it. The keyboard works fine, but the mouse does not.

You can see this on your demo site. Go to the html tab, modify the opening p tag to include 'width:300px;' in the style, and go back to the design tab. Try to use the mouse to select some text.

The previous version I was using was 2013.2.717. No problem there.

The problem happens in all versions of IE. It seems to work properly in Firefox and Chrome.
Dan Ehrmann
Top achievements
Rank 1
 answered on 06 Jun 2014
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?