Telerik Forums
UI for ASP.NET AJAX Forum
1 answer
175 views
Hello Team,

We are using Rad grid with Form template  edit form, we need to place Radio button list with 2 options "Male" and "Female" for gender inside FormTemplate.

Please find Error below:
 
Uncaught Sys.WebForms.PageRequestManagerServerErrorException: Sys.WebForms.PageRequestManagerServerErrorException: 'rbtGender' has a SelectedValue which is invalid because it does not exist in the list of items.<br>Parameter name: value


Code below:
<telerik:RadGrid ID="rgDemoRestrictedTests" runat="server" CssClass="RadGrid" GridLines="None" AllowPaging="True" PageSize="20" AllowSorting="True"
                                                      AutoGenerateColumns="false" ShowStatusBar="true" AllowAutomaticDeletes="True" AllowAutomaticInserts="True" AllowAutomaticUpdates="True"
                                                      DataSourceID="DemoRestrictedTestsSource" OnItemDeleted="rgDemoRestrictedTests_ItemDeleted" OnItemInserted="rgDemoRestrictedTests_ItemInserted"
                                                      OnItemUpdated="rgDemoRestrictedTests_ItemUpdated" OnItemCommand="rgDemoRestrictedTests_ItemCommand">
                                                      <MasterTableView CommandItemDisplay="Bottom" DataSourceID="DemoRestrictedTestsSource" DataKeyNames="TestID">
                                                          <Columns>
                                                              <telerik:GridBoundColumn UniqueName="TestID" HeaderText="TestID" DataField="TestID">
                                                              </telerik:GridBoundColumn>
                                                              <telerik:GridBoundColumn UniqueName="Gender" HeaderText="Gender" DataField="Gender">
                                                              </telerik:GridBoundColumn>                                                          
                                                              <telerik:GridEditCommandColumn HeaderText="Edit">
                                                              </telerik:GridEditCommandColumn>
                                                              <telerik:GridButtonColumn CommandName="Delete" Text="Delete" HeaderText="Delete">
                                                              </telerik:GridButtonColumn>
                                                          </Columns>
                                                          <EditFormSettings EditFormType="Template">
                                                              <FormTemplate>
                                                                  <table id="Table2" cellspacing="2" cellpadding="1" width="100%" border="0" rules="none"
                                                                      style="border-collapse: collapse;">
                                                                      <tr>
                                                                          <td>
                                                                              <table id="Table3" width="450px" border="0" class="module">
                                                                                  <tr>
                                                                                      <td style="text-align: center;">TestID :
                                                                                      </td>
                                                                                      <td>
                                                                                          <asp:DropDownList ID="rddlTestID" runat="server" SelectedValue='<%#  Bind("TestID")  %>'
                                                                                              DataSourceID="rddlTestIDSource" DataTextField="TestID" DataValueField="TestID" AppendDataBoundItems="True">
                                                                                              <asp:ListItem Selected="True" Text="Select" Value="">
                                                                                              </asp:ListItem>
                                                                                          </asp:DropDownList>
 
                                                                                      </td>
                                                                                  </tr>
                                                                                  <tr>
                                                                                      <td style="text-align: center;">Gender :
                                                                                      </td>
                                                                                      <td>
                                                                                          <asp:RadioButtonList runat="server" ID="rbtGender" RepeatDirection="Horizontal" DataValueField="Gender" SelectedValue='<%#  Bind("Gender") %>'>
                                                                                              <asp:ListItem Text="Male" Value="Male" Selected="True"></asp:ListItem>
                                                                                              <asp:ListItem Text="Female" Value="Female"></asp:ListItem>
                                                                                          </asp:RadioButtonList>
                                                                                      </td>
                                                                                  </tr>                                                                                 
 
                                                                              </table>
                                                                          </td>
                                                                      </tr>
                                                                      <tr>
                                                                          <td colspan="2"></td>
                                                                      </tr>
                                                                      <tr>
                                                                          <td></td>
                                                                          <td></td>
                                                                      </tr>
                                                                      <tr>
                                                                          <td align="rifht" colspan="2">
                                                                              <asp:Button ID="btnUpdate" Text='<%# (Container is GridEditFormInsertItem) ? "Insert" : "Update" %>'
                                                                                  runat="server" CommandName='<%# (Container is GridEditFormInsertItem) ? "PerformInsert" : "Update" %>'></asp:Button
                                                                       <asp:Button ID="btnCancel" Text="Cancel" runat="server" CausesValidation="False" CommandName="Cancel"></asp:Button>
                                                                          </td>
                                                                      </tr>
                                                                  </table>
                                                              </FormTemplate>
                                                          </EditFormSettings>
                                                      </MasterTableView>                                                     
                                                  </telerik:RadGrid>
                                              </telerik:RadPageView>
<asp:SqlDataSource runat="server" ID="DemoRestrictedTestsSource" ConnectionString="x" ProviderName="System.Data.SqlClient"
                                          SelectCommand="Select [TestID], (case when [Gender] = 0 then 'Male' else 'Female' end) as [Gender] From [TestUtil_DemoRestrictedTests]"
                                          InsertCommand="Insert Into [TestUtil_DemoRestrictedTests] Values ('@TestID', (case when @Gender = 'Male' then 1 else 0 end))"
                                          UpdateCommand="Update [TestUtil_DemoRestrictedTests] Set [Gender] = (case when @Gender = 'Male' then 0 else 1 end) Where [TestID] = @TestID"
                                          DeleteCommand="DELETE FROM [TestUtil_DemoRestrictedTests] WHERE [TestID] = @TestID">
                                          <InsertParameters>
                                              <asp:Parameter Name="TestID" Type="String" />
                                              <asp:Parameter Name="Gender" Type="String" />                                             
                                          </InsertParameters>
                                          <UpdateParameters>
                                              <asp:Parameter Name="Gender" Type="string" />                                           
                                              <asp:Parameter Name="TestID" Type="String" />
                                          </UpdateParameters>
                                          <DeleteParameters>
                                              <asp:Parameter Name="TestID" Type="String" />
                                          </DeleteParameters>
                                      </asp:SqlDataSource>


Can anyone help me out with this error?

Thanks in advance.

Regards,
Ruchi Patel
Eyup
Telerik team
 answered on 10 Feb 2015
1 answer
1.1K+ views
Hi

How to use custom filter in telerik radgrid  using C# Code no need svc and Datasource 

Eyup
Telerik team
 answered on 10 Feb 2015
1 answer
133 views
The following problem happens when using IE11. I haven't been able to recreate the issue with Firefox and Chrome. 

1. Use the Editor demo page and the HTML below. 
2. Switch to design mode and right click either table...select table properties.

The version on your demo page currently places the edited table inside the table below it. I'm currently using version 2014.2.724.45...for me it deletes the table when the Table Properties dialog is closed. 

This doesn't happen with all tables...and for the most part editing tables works as expected in IE11. The HTML below is an example of what can cause the problem.

<table style="width: 746px; height: 274px;">
    <tbody>
        <tr>
            <td style="text-align: center; vertical-align: top;">

                <a href="#0" tabindex="-1">
                    <img alt="" style="border-width: 3px; border-style: solid; margin-right: 0px; vertical-align: top;" src="0.jpg" />
                </a>
                <br />
                Number 0<br />
                Title
            </td>

            <td style="text-align: center; vertical-align: top;"><a href="#1" tabindex="-1">
                <img alt="" style="border-width: 3px; border-style: solid; margin-right: 0px; vertical-align: top;" src="1.jpg" /></a><br />
                Number 1<br />
                Title </td>
            <td style="text-align: center; vertical-align: top;"><a href="#2" tabindex="-1">
                <img alt="" style="border-width: 3px; border-style: solid; margin-right: 0px; vertical-align: top;" src="2.jpg" /></a><br />
                Number 2<br />
               Title</td>
            <td style="text-align: center; vertical-align: top;"><a href="#3" tabindex="-1">
                <img alt="" style="border-width: 3px; border-style: solid; margin-right: 0px; vertical-align: top;" src="3.jpg" /></a><br />
                Number 3<br />
                Title</td>
            <td style="text-align: center; vertical-align: top;"><a href="#4" tabindex="-1">
                <img alt="" style="border-width: 3px; border-style: solid; margin-right: 0px; vertical-align: top;" src="4.jpg" /></a><br />
                Number 4<br />
                Title</td>
            <td style="text-align: center; vertical-align: top;"><a href="#5" tabindex="-1" target="_self">
                <img alt="" style="border-width: 3px; border-style: solid; width: 125px; height: 175px; margin-left: 0px; vertical-align: top;" src="5.jpg" /></a><br />
                Number 5<br />
        </tr>
    </tbody>
</table>
<hr />
<table style="width: 695px; height: 726px;">
    <tbody>
        <tr>
            <td style="text-align: center; vertical-align: top;"><a href="#10" tabindex="-1">
                <img alt="" style="border-width: 3px; border-style: solid; vertical-align: top;" src="10.jpg" /></a>10<br />
                Number 10<br />
                Title 2</td>
            <td style="text-align: center; vertical-align: top;"><a href="#11" tabindex="-1">
                <img alt="" style="border-width: 3px; border-style: solid; vertical-align: top;" src="11.jpg" /></a>11<br />
                Number 11<br />
                Title 2</td>
            <td style="text-align: center; vertical-align: top;"><a href="#12" tabindex="-1">
                <img alt="" style="border-width: 3px; border-style: solid; vertical-align: top;" src="12.jpg" /></a>12<br />
                Number 12
                <br />
                Title 2</td>
            <td style="text-align: center; vertical-align: top;"><a href="#13" tabindex="-1" target="_self">
                <img alt="" style="border-width: 3px; border-style: solid; vertical-align: top;" src="13.jpg" /></a>13<br />
                 Number 13 <br />
               Title2 </td>
            <td style="text-align: center; vertical-align: top;"><a href="#14" tabindex="-1">
                <img alt="" style="border-width: 3px; border-style: solid; vertical-align: top;" src="14.jpg" /></a><br />
                Number 14<br />
                Title 2
                <br />
                Title</td>
            <td style="text-align: center; vertical-align: top;">
                <img alt="" style="border-width: 3px; border-style: solid; width: 125px; height: 176px; vertical-align: top;" src="15.JPG" /><br />
                Number 15<br />
                Title</td>
        </tr>

    </tbody>
</table>

Ianko
Telerik team
 answered on 10 Feb 2015
1 answer
57 views
Hello Folks,

we are having trouble with a specific constellation of the Grid Batch Edit Mode and Read Only Textfields (Gridbound Textcolumns).
Im blocking the Batcheditmode in the OnBatchEditOpening event and with modern browsers everything works as expected.

Though with IE 9 and IE 8 in Compatiblity Mode, we are having issues.

CSS wise, the fields are blocked and readonly, but unfortunatly the user is still able to enter text. Is there any known workaround?
The code is used in a SharePoint Webpart, hence changing the Documentmode is not a viable solution.

We are using the latest 2014 Release: 2014.3.1209.35
Maria Ilieva
Telerik team
 answered on 10 Feb 2015
1 answer
89 views
Hi,

I'm new to  kendo and i was trying to display a treeView using the ASP MVC approach so i followed the exemple you provided :

var employees = from e in db.Employees
                            where (id.HasValue ? e.ReportsTo == id : e.ReportsTo == null)
                            select new
                            {
                                id = e.id,
                                Name = e.FirstName + " " + e.LastName,
                                hasChildren = e.Employees1.Any()
                            };

My question is:  where the Employees1 comes from ? (I guess from the model) but what is the code inside this function ? where's the recursive function to loop on each child ? Can you provide the model and see what is inside ? 

Thanks
Daniel
Telerik team
 answered on 10 Feb 2015
1 answer
109 views
Hi Team,

I want to create a grid where second column is split to 3 rows. could you please give me the layout aspx how to create.

grid view is attached here. The grid is linked to a db

thanks
Sabitri Mohanty


Pavlina
Telerik team
 answered on 10 Feb 2015
1 answer
65 views
I have an OpenAccessLinqDataSource that pulls from some FK linked tables. The FK value is nullable (UInt32?) and while sorting works, I'm having some difficulties filtering.

Here's my LinqDataSource
<telerik:OpenAccessLinqDataSource ID="OA_Promos" Runat="server" ContextTypeName="Flow.ST2_Data" EntityTypeName="" OrderBy="ID desc" ResourceSetName="Promos" Select="new (ID, identifier, descriptor, lastUpdated, notes, startDate, endDate, startTime, endTime, priority, Promo_art.Art, Promo_art.width, Promo_art.height, Promo_art.fileName, Promo_topic.SpotID)" Where="Deleted == @Deleted" >
    <WhereParameters>
        <asp:Parameter DefaultValue="0" Name="Deleted" Type="Int16" />
    </WhereParameters>
</telerik:OpenAccessLinqDataSource>

The Promo_topic.SpotID is the column I'm trying to filter on using the following:
<telerik:GridBoundColumn DataField="Promo_topic.SpotID" AllowFiltering="true" SortExpression="SpotID" CurrentFilterFunction="EqualTo" FilterControlAltText="Filter SpotID Column" AutoPostBackOnFilter="true" ShowFilterIcon="False" UniqueName="SpotID" HeaderText="Spot ID" DataType="System.UInt32"></telerik:GridBoundColumn>

but I get 0 results returned when I filter on a valid Promo_topic.SpotID


I tried custom filtering:
<telerik:GridBoundColumn DataField="Promo_topic.SpotID" AllowFiltering="true" SortExpression="SpotID" CurrentFilterFunction="Custom" FilterControlAltText="Filter SpotID Column" AutoPostBackOnFilter="true" ShowFilterIcon="False" UniqueName="SpotID" HeaderText="Spot ID" DataType="System.UInt32"></telerik:GridBoundColumn>

with the following ItemCommand event:
protected void ItemCommandFired(object sender, GridCommandEventArgs e)
{
    if (e.CommandName == RadGrid.FilterCommandName)
    {
        Pair filterPair = (Pair)e.CommandArgument;
        if (filterPair.First.ToString() == "Custom")
        {
            string colName = filterPair.Second.ToString();
            TextBox tbPattern = (e.Item as GridFilteringItem)[colName].Controls[0] as TextBox;
            e.Canceled = true;
            grid_promos.MasterTableView.FilterExpression = string.Format("(Promo_topic.SpotID.Equals({0})) AND (Promo_topic.SpotID != null)", tbPattern.Text);
            grid_promos.Rebind();
        }
    }
}

but then get the error "Methods on type 'UInt32?' are not accessible"

Before I switch the entire DataLinqSource to reference a custom object, is there something I'm doing wrong?

Thanks.
Marin
Telerik team
 answered on 10 Feb 2015
1 answer
222 views
Can you use RadEditor to upload a pdf, like an image,  and then have the pdf display on the screen and not a link?



Ianko
Telerik team
 answered on 10 Feb 2015
3 answers
178 views
Hi,

When adding content using pasteHtml method, it's adding <br> tag before the text in chrome browser due to which an extra line is appearing. This issue can also be reproduced using existing tool e.g. "Insert Time". The issue will be gone when you switch between HTML view and Design view. Check this screen cast: http://screencast.com/t/liOx9ryeIp1 

Any work-around to fix this issue?

I'm using "ASP.NET AJAX Q2 2014" (2014.2.724.40) version.

Also I'm disabling ConvertToXhtml, ConvertCharactersToEntities, ConvertFontToSpan, and RemoveScripts filters. And NewLineMode = EditorNewLineModes.Div.

Thanks,
Anil

Marin Bratanov
Telerik team
 answered on 10 Feb 2015
2 answers
110 views
Hi,
I've got my drop down lists working with border coloured validation using JQuery.  Now that I am trying to do the same thing with RadComboBoxes I can't seem to get the relevant css classes.  Below is how I am doing this to the drop down lists.  How do I do the same with ComboBoxes?

Regards

Jon

var $ = $telerik.$;
var dropDown = dropDownTree.get_element();
if (eventArgs.IsValid === false) {
    $(dropDown).find(".rddtInner").addClass("RadDropDownTreeFieldErrorHighlight");
} else {
    $(dropDown).find(".rddtInner").removeClass("RadDropDownTreeFieldErrorHighlight");
}
Jon
Top achievements
Rank 1
 answered on 10 Feb 2015
Narrow your results
Selected tags
Tags
+? more
Top users last month
Rob
Top achievements
Rank 3
Bronze
Iron
Iron
Sergii
Top achievements
Rank 1
Iron
Iron
Dedalus
Top achievements
Rank 1
Iron
Iron
Lan
Top achievements
Rank 1
Iron
Doug
Top achievements
Rank 1
Want to show your ninja superpower to fellow developers?
Top users last month
Rob
Top achievements
Rank 3
Bronze
Iron
Iron
Sergii
Top achievements
Rank 1
Iron
Iron
Dedalus
Top achievements
Rank 1
Iron
Iron
Lan
Top achievements
Rank 1
Iron
Doug
Top achievements
Rank 1
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?