Telerik Forums
UI for ASP.NET AJAX Forum
1 answer
104 views
When I Convert Grid column to template column its give me this error 'Object reference not set to an instance of an object.'

My Code Is:

    <form id="form1" runat="server">
    <telerik:RadScriptManager runat="server" ID="RadScriptManager1" />
    <telerik:RadSkinManager ID="QsfSkinManager" runat="server" ShowChooser="true" />
    <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" />
                </UpdatedControls>
            </telerik:AjaxSetting>
        </AjaxSettings>
    </telerik:RadAjaxManager>
    <telerik:RadAjaxLoadingPanel ID="RadAjaxLoadingPanel1" runat="server" />
    <telerik:RadGrid ID="RadGrid1" runat="server" DataSourceID="SqlDataSource1" 
        AllowMultiRowSelection="True" AllowMultiRowEdit="True" 
        AllowPaging="True" AllowAutomaticUpdates="True" AllowAutomaticInserts="True"
        AllowAutomaticDeletes="True" AllowSorting="True" AllowCustomPaging="True" 
        AllowFilteringByColumn="True" CellSpacing="0" GridLines="None" 
        ShowGroupPanel="True" AutoGenerateDeleteColumn="True" 
        AutoGenerateEditColumn="True" AutoGenerateHierarchy="True" 
        EnableHeaderContextAggregatesMenu="True" EnableHeaderContextFilterMenu="True" 
        EnableHeaderContextMenu="True" ShowFooter="True">
        <ClientSettings AllowDragToGroup="True">
            <Scrolling AllowScroll="True" UseStaticHeaders="True" />
        </ClientSettings>
        <MasterTableView DataSourceID="SqlDataSource1" AutoGenerateColumns="False"
            DataKeyNames="ID" CommandItemDisplay="Top" PageSize="5" 
            EnableHeaderContextAggregatesMenu="True">
            <Columns>
                <telerik:GridTemplateColumn DataField="ID" DataType="System.Int32" 
                    FilterControlAltText="Filter ID column" HeaderText="ID" SortExpression="ID" 
                    UniqueName="ID">
                    <EditItemTemplate>
                        <asp:TextBox ID="IDTextBox" runat="server" Text='<%# Bind("ID") %>'></asp:TextBox>
                    </EditItemTemplate>
                    <ItemTemplate>
                        <asp:Label ID="IDLabel" runat="server" Text='<%# Eval("ID") %>'></asp:Label>
                    </ItemTemplate>
                </telerik:GridTemplateColumn>
                <telerik:GridTemplateColumn DataField="ExamID" DataType="System.Int32" 
                    FilterControlAltText="Filter ExamID column" HeaderText="ExamID" 
                    SortExpression="ExamID" UniqueName="ExamID">
                    <EditItemTemplate>
                        <asp:TextBox ID="ExamIDTextBox" runat="server" Text='<%# Bind("ExamID") %>'></asp:TextBox>
                    </EditItemTemplate>
                    <ItemTemplate>
                        <asp:Label ID="ExamIDLabel" runat="server" Text='<%# Eval("ExamID") %>'></asp:Label>
                    </ItemTemplate>
                </telerik:GridTemplateColumn>
                <telerik:GridTemplateColumn DataField="Subject" 
                    FilterControlAltText="Filter Subject column" HeaderText="Subject" 
                    SortExpression="Subject" UniqueName="Subject">
                    <EditItemTemplate>
                        <asp:TextBox ID="SubjectTextBox" runat="server" Text='<%# Bind("Subject") %>'></asp:TextBox>
                    </EditItemTemplate>
                    <ItemTemplate>
                        <asp:Label ID="SubjectLabel" runat="server" Text='<%# Eval("Subject") %>'></asp:Label>
                    </ItemTemplate>
                </telerik:GridTemplateColumn>
                <telerik:GridTemplateColumn DataField="StartTime" DataType="System.DateTime" 
                    FilterControlAltText="Filter StartTime column" HeaderText="StartTime" 
                    SortExpression="StartTime" UniqueName="StartTime">
                    <EditItemTemplate>
                        <asp:TextBox ID="StartTimeTextBox" runat="server" 
                            Text='<%# Bind("StartTime") %>'></asp:TextBox>
                    </EditItemTemplate>
                    <ItemTemplate>
                        <asp:Label ID="StartTimeLabel" runat="server" Text='<%# Eval("StartTime") %>'></asp:Label>
                    </ItemTemplate>
                </telerik:GridTemplateColumn>
                <telerik:GridTemplateColumn DataField="EndTime" DataType="System.DateTime" 
                    FilterControlAltText="Filter EndTime column" HeaderText="EndTime" 
                    SortExpression="EndTime" UniqueName="EndTime">
                    <EditItemTemplate>
                        <asp:TextBox ID="EndTimeTextBox" runat="server" Text='<%# Bind("EndTime") %>'></asp:TextBox>
                    </EditItemTemplate>
                    <ItemTemplate>
                        <asp:Label ID="EndTimeLabel" runat="server" Text='<%# Eval("EndTime") %>'></asp:Label>
                    </ItemTemplate>
                </telerik:GridTemplateColumn>
                <telerik:GridTemplateColumn DataField="Recurrence" 
                    FilterControlAltText="Filter Recurrence column" HeaderText="Recurrence" 
                    SortExpression="Recurrence" UniqueName="Recurrence">
                    <EditItemTemplate>
                        <asp:TextBox ID="RecurrenceTextBox" runat="server" 
                            Text='<%# Bind("Recurrence") %>'></asp:TextBox>
                    </EditItemTemplate>
                    <ItemTemplate>
                        <asp:Label ID="RecurrenceLabel" runat="server" Text='<%# Eval("Recurrence") %>'></asp:Label>
                    </ItemTemplate>
                </telerik:GridTemplateColumn>
                <telerik:GridTemplateColumn DataField="RecurParentID" DataType="System.Int32" 
                    FilterControlAltText="Filter RecurParentID column" HeaderText="RecurParentID" 
                    SortExpression="RecurParentID" UniqueName="RecurParentID">
                    <EditItemTemplate>
                        <asp:TextBox ID="RecurParentIDTextBox" runat="server" 
                            Text='<%# Bind("RecurParentID") %>'></asp:TextBox>
                    </EditItemTemplate>
                    <ItemTemplate>
                        <asp:Label ID="RecurParentIDLabel" runat="server" 
                            Text='<%# Eval("RecurParentID") %>'></asp:Label>
                    </ItemTemplate>
                </telerik:GridTemplateColumn>
                <telerik:GridEditCommandColumn ButtonType="ImageButton">
</telerik:GridEditCommandColumn>
              
            </Columns>
            <EditFormSettings>
                <EditColumn ButtonType="ImageButton" />
            </EditFormSettings>
            <PagerStyle AlwaysVisible="True" />
        </MasterTableView>
        <PagerStyle Mode="NextPrevAndNumeric" AlwaysVisible="True" />
    </telerik:RadGrid>
    

       <asp:SqlDataSource ID="SqlDataSource1" runat="server" 
            ConnectionString="<%$ ConnectionStrings:telerikMssqlDBConnectionString %>" 
            DeleteCommand="DELETE FROM [Appointment_Data] WHERE [ID] = @ID" 
            InsertCommand="INSERT INTO [Appointment_Data] ([ExamID], [Subject], [StartTime], [EndTime], [Recurrence], [RecurParentID]) VALUES (@ExamID, @Subject, @StartTime, @EndTime, @Recurrence, @RecurParentID)" 
            SelectCommand="SELECT [ID], [ExamID], [Subject], [StartTime], [EndTime], [Recurrence], [RecurParentID] FROM [Appointment_Data] ORDER BY [ID] DESC" 
            
                 UpdateCommand="UPDATE [Appointment_Data] SET [ExamID] = @ExamID, [Subject] = @Subject, [StartTime] = @StartTime, [EndTime] = @EndTime, [Recurrence] = @Recurrence, [RecurParentID] = @RecurParentID WHERE [ID] = @ID">
            <DeleteParameters>
                <asp:Parameter Name="ID" Type="Int32" />
            </DeleteParameters>
            <InsertParameters>
                <asp:Parameter Name="ExamID" Type="Int32" />
                <asp:Parameter Name="Subject" Type="String" />
                <asp:Parameter Name="StartTime" Type="DateTime" />
                <asp:Parameter Name="EndTime" Type="DateTime" />
                <asp:Parameter Name="Recurrence" Type="String" />
                <asp:Parameter Name="RecurParentID" Type="Int32" />
            </InsertParameters>
            <UpdateParameters>
                <asp:Parameter Name="ExamID" Type="Int32" />
                <asp:Parameter Name="Subject" Type="String" />
                <asp:Parameter Name="StartTime" Type="DateTime" />
                <asp:Parameter Name="EndTime" Type="DateTime" />
                <asp:Parameter Name="Recurrence" Type="String" />
                <asp:Parameter Name="RecurParentID" Type="Int32" />
                <asp:Parameter Name="ID" Type="Int32" />
            </UpdateParameters>
        </asp:SqlDataSource>




    </form>

Princy
Top achievements
Rank 2
 answered on 31 Jan 2014
2 answers
122 views
Hi, I am using a RadGrid with a custom edit form to insert data.

Is it possible to have a combo box with the options 'Yes' and 'No' that triggers the visibility of another input field (date picker) and can make it a required field?
Princy
Top achievements
Rank 2
 answered on 31 Jan 2014
1 answer
126 views
Hi

I'm creating a web page with radgrid on it and have a few columns with radtimepicker controls in an  itemtemplate section. Each column has two radtimepicker controls where I am selecting start and end time. I am trying to validate the time so the start time is always before the end time and the end time is always after the start time. I'm trying to get the row index on a client side event so I can get the value of the end time. Please can someone suggest me how to get the row index?

I tried various options but they don't seem to work.

Many thanks!
Jayesh Goyani
Top achievements
Rank 2
 answered on 31 Jan 2014
1 answer
167 views
Currently have 2 dropdown lists (month & year) that I would like to validate they are not blank and verify that they aren't for a future date.  I am unable to get the value via jquery.  Suggestions?

<script type=
"text/javascript">
    var oWnd;
    //<![CDATA[
    function daysInMonth(month, year) {
        return new Date(year, month, 0).getDate();
    }
 
    function openRadWin(InMode) {
        //Removes the scroll bars from the Parent Window
        removeScrollbars();
 
        var MonthInput = $find("<%= _NewMonth.ClientID %>");
        var YearInput = $find("<%= _newYear.ClientID %>");
        var newVal = $('#_newYear').val();
        var dropFind = $find("<%= _NewMonth.ClientID %>");
        var valueFind = dropFind.get_value();
 
        alert(valueFind);
}
</script>




New statement cycle date <strong>(mm/dd/yyyy)</strong>:
<telerik:RadDropDownList ID="_NewMonth" runat="server" DefaultMessage="Select a Month">
    <Items>
        <telerik:DropDownListItem runat="server" Selected="false" Text="January" Value="1" />
        <telerik:DropDownListItem runat="server" Selected="false" Text="February" Value="2" />
        <telerik:DropDownListItem runat="server" Selected="false" Text="March" Value="3" />
        <telerik:DropDownListItem runat="server" Selected="false" Text="April" Value="4" />
        <telerik:DropDownListItem runat="server" Selected="false" Text="May" Value="5" />
        <telerik:DropDownListItem runat="server" Selected="false" Text="June" Value="6" />
        <telerik:DropDownListItem runat="server" Selected="false" Text="July" Value="7" />
        <telerik:DropDownListItem runat="server" Selected="false" Text="August" Value="8" />
        <telerik:DropDownListItem runat="server" Selected="false" Text="September" Value="9" />
        <telerik:DropDownListItem runat="server" Selected="false" Text="October" Value="10" />
        <telerik:DropDownListItem runat="server" Selected="false" Text="November" Value="11" />
        <telerik:DropDownListItem runat="server" Selected="false" Text="December" Value="12" />
    </Items>
</telerik:RadDropDownList>
<telerik:RadDropDownList ID="_NewYear" runat="server">
</telerik:RadDropDownList>
Shinu
Top achievements
Rank 2
 answered on 31 Jan 2014
5 answers
99 views
I have a radEditor that does not seem to post new / changed content when used with ie10. Chrome seems to work fine. We just upgraded to the latest internal build and have not changed anthing else within the project. The editor is located in a user control and inside an update panel. the buttons we are using to call the serverside function that saves the content are image buttons. With the previous versions of the dll we had no issues with this setup. I have put breakpoints at the page_load and other events but the value never seems to get changed. I have also used the textbox technique described in another post and the text box value is updating fine but the radEditor is not. 

Additionally, the radTooltip does not seem to show the tooltip on the hover event under ie10. works in chrome. same scenerio as above, no change in project, just the telerik upgrade.

Thanks,
Scott
Daniel
Top achievements
Rank 1
Iron
Iron
Iron
 answered on 31 Jan 2014
0 answers
38 views
I am using Telerik.Web.Mvc Chart control and want to replace the text in the category axis with images such as .png or .jpeg files. Please let me know how this can be achieved? Is this supported in Telerik.Web.Mvc Chart. If not, what will be the work around to load images?  --Sridhar Thirumal
Sridhar
Top achievements
Rank 1
 asked on 30 Jan 2014
2 answers
196 views
Please Help,

I have a Grid placed inside a nested multipage.  The Multipage is affected by tabs.  Ill try to explain below.

-outer Multipage
    -PageView: Contains Tabs and Related MultiPage
        -inner MultiPage: Contains Tab Pages which contain the Grids in question
    -PageView: Contains FormView to display the details of the item selected in the other Grids.

So what is happening is that when I wanted to Tabs to postback when selected I set the autopostback to true and then added to the RadAjax manager below
<telerik:AjaxSetting AjaxControlID="Tabs">
    <UpdatedControls>
        <telerik:AjaxUpdatedControl ControlID="Tabs" />
        <telerik:AjaxUpdatedControl ControlID="OuterMultiPage" />
    </UpdatedControls>
</telerik:AjaxSetting>
When the tab is selected it changes the OuterMultiPage to show the Page with the Grids Multipage.  That part works but the GridData section of the grid is set to 10px for the height.  I have no Idea why.  I tried to create a GridCreated client event to set the height back to 100% but then I lose my scrollbars and when I resize the page it goes right back to 10%.

Any Ideas.

Thanks for any help in advance.
Sameer
Top achievements
Rank 1
 answered on 30 Jan 2014
1 answer
101 views
I am using Telerik version 2013.3.1015.40 and working with Visual Studio 2010.
I recently migrated my code to VS 2010 from VS 2008.

In 2010 I don't see the border and the dropdown image for my combobox. I am using custom skin.
Below is my combobox declaration and my custom skin:

<telerik:RadComboBox ID="rcbPlans" runat="server" DataSourceID="_dataSrcPlans" DataTextField="PlanName" EnableEmbeddedSkins="false" Skin="MBen"  OnDataBound="rcbPlans_DataBound" DataValueField="PlanInfo" OnSelectedIndexChanged="rcbPlans_SelectedIndexChanged"  AutoPostBack="true" Width="250px">
</telerik:RadComboBox>

.RadComboBox_MBen {
  color: black;
  font: normal 12px Verdana, Arial, Helvetica, sans-serif; }
  .RadComboBox_MBen .rcbInputCell,
  .RadComboBox_MBen .rcbArrowCell {
    background-image: url('Common/radFormSprite.png');
    _background-image: url('Common/radFormSpriteIE6.png'); }
  .RadComboBox_MBen .rcbInputCellLeft {
    background-position: 0 0; }
  .RadComboBox_MBen .rcbInputCellRight {
    background-position: 100% 0; }
  .RadComboBox_MBen .rcbInput {
    color: black;
    font: normal 12px Verdana, Arial, Helvetica, sans-serif;
    line-height: 16px; }
  .RadComboBox_MBen .rcbEmptyMessage {
    color: #a7a7a7;
    font-style: italic; }
  .RadComboBox_MBen .rcbArrowCellLeft {
    background-position: 0 -176px; }
  .RadComboBox_MBen .rcbArrowCellRight {
    background-position: -18px -176px; }
  .RadComboBox_MBen .rcbArrowCellLeft.rcbArrowCellHidden {
    background-position: 0 0; }
  .RadComboBox_MBen .rcbArrowCellRight.rcbArrowCellHidden {
    background-position: 100% 0; }
  .RadComboBox_MBen .rcbHovered .rcbInputCellLeft {
    background-position: 0 -22px; }
  .RadComboBox_MBen .rcbHovered .rcbInputCellRight {
    background-position: 100% -22px; }
  .RadComboBox_MBen .rcbHovered .rcbInput {
    color: black; }
  .RadComboBox_MBen .rcbHovered .rcbArrowCellLeft {
    background-position: -36px -176px; }
  .RadComboBox_MBen .rcbHovered .rcbArrowCellRight {
    background-position: -54px -176px; }
  .RadComboBox_MBen .rcbHovered .rcbArrowCellLeft.rcbArrowCellHidden {
    background-position: 0 -22px; }
  .RadComboBox_MBen .rcbHovered .rcbArrowCellRight.rcbArrowCellHidden {
    background-position: 100% -22px; }
  .RadComboBox_MBen .rcbFocused .rcbInputCellLeft {
    background-position: 0 -44px; }
  .RadComboBox_MBen .rcbFocused .rcbInputCellRight {
    background-position: 100% -44px; }
  .RadComboBox_MBen .rcbFocused .rcbInput {
    color: black; }
  .RadComboBox_MBen .rcbFocused .rcbArrowCellLeft {
    background-position: -72px -176px; }
  .RadComboBox_MBen .rcbFocused .rcbArrowCellRight {
    background-position: -90px -176px; }
  .RadComboBox_MBen .rcbFocused .rcbArrowCellLeft.rcbArrowCellHidden {
    background-position: 0 -44px; }
  .RadComboBox_MBen .rcbFocused .rcbArrowCellRight.rcbArrowCellHidden {
    background-position: 100% -44px; }
  .RadComboBox_MBen .rcbDisabled .rcbInputCellLeft {
    background-position: 0 -66px; }
  .RadComboBox_MBen .rcbDisabled .rcbInputCellRight {
    background-position: 100% -66px; }
  .RadComboBox_MBen .rcbDisabled .rcbInput {
    color: #a7a7a7; }
  .RadComboBox_MBen .rcbDisabled .rcbArrowCellLeft {
    background-position: -108px -176px; }
  .RadComboBox_MBen .rcbDisabled .rcbArrowCellRight {
    background-position: -126px -176px; }
  .RadComboBox_MBen .rcbDisabled .rcbArrowCellLeft.rcbArrowCellHidden {
    background-position: 0 -66px; }
  .RadComboBox_MBen .rcbDisabled .rcbArrowCellRight.rcbArrowCellHidden {
    background-position: 100% -66px; }
  .RadComboBox_MBen .rcbReadOnly .rcbInputCellLeft {
    background-position: 0 -88px; }
  .RadComboBox_MBen .rcbReadOnly .rcbInputCellRight {
    background-position: 100% -88px; }
  .RadComboBox_MBen .rcbReadOnly .rcbInput {
    color: #1e395b; }
  .RadComboBox_MBen .rcbReadOnly .rcbArrowCellLeft {
    background-position: -144px -176px; }
  .RadComboBox_MBen .rcbReadOnly .rcbArrowCellRight {
    background-position: -162px -176px; }
  .RadComboBox_MBen .rcbReadOnly .rcbArrowCellLeft.rcbArrowCellHidden {
    background-position: 0 -88px; }
  .RadComboBox_MBen .rcbReadOnly .rcbArrowCellRight.rcbArrowCellHidden {
    background-position: 100% -88px; }
  .RadComboBox_MBen .rcbHovered .rcbReadOnly .rcbInputCellLeft {
    background-position: 0 -110px; }
  .RadComboBox_MBen .rcbHovered .rcbReadOnly .rcbInputCellRight {
    background-position: 100% -110px; }
  .RadComboBox_MBen .rcbHovered .rcbReadOnly .rcbInput {
    color: #1e395b; }
  .RadComboBox_MBen .rcbHovered .rcbReadOnly .rcbArrowCellLeft {
    background-position: -180px -176px; }
  .RadComboBox_MBen .rcbHovered .rcbReadOnly .rcbArrowCellRight {
    background-position: -198px -176px; }
  .RadComboBox_MBen .rcbHovered .rcbReadOnly .rcbArrowCellLeft.rcbArrowCellHidden {
    background-position: 0 -110px; }
  .RadComboBox_MBen .rcbHovered .rcbReadOnly .rcbArrowCellRight.rcbArrowCellHidden {
    background-position: 100% -110px; }
  .RadComboBox_MBen .rcbFocused .rcbReadOnly .rcbInputCellLeft {
    background-position: 0 -132px; }
  .RadComboBox_MBen .rcbFocused .rcbReadOnly .rcbInputCellRight {
    background-position: 100% -132px; }
  .RadComboBox_MBen .rcbFocused .rcbReadOnly .rcbInput {
    color: #1e395b; }
  .RadComboBox_MBen .rcbFocused .rcbReadOnly .rcbArrowCellLeft {
    background-position: -216px -176px; }
  .RadComboBox_MBen .rcbFocused .rcbReadOnly .rcbArrowCellRight {
    background-position: -234px -176px; }
  .RadComboBox_MBen .rcbFocused .rcbReadOnly .rcbArrowCellLeft.rcbArrowCellHidden {
    background-position: 0 -132px; }
  .RadComboBox_MBen .rcbFocused .rcbReadOnly .rcbArrowCellRight.rcbArrowCellHidden {
    background-position: 100% -132px; }
  .RadComboBox_MBen .rcbDisabled .rcbReadOnly .rcbInputCellLeft {
    background-position: 0 -154px; }
  .RadComboBox_MBen .rcbDisabled .rcbReadOnly .rcbInputCellRight {
    background-position: 100% -154px; }
  .RadComboBox_MBen .rcbDisabled .rcbReadOnly .rcbInput {
    color: #a7a7a7; }
  .RadComboBox_MBen .rcbDisabled .rcbReadOnly .rcbArrowCellLeft {
    background-position: -252px -176px; }
  .RadComboBox_MBen .rcbDisabled .rcbReadOnly .rcbArrowCellRight {
    background-position: -270px -176px; }
  .RadComboBox_MBen .rcbDisabled .rcbReadOnly .rcbArrowCellLeft.rcbArrowCellHidden {
    background-position: 0 -154px; }
  .RadComboBox_MBen .rcbDisabled .rcbReadOnly .rcbArrowCellRight.rcbArrowCellHidden {
    background-position: 100% -154px; }
 
.RadComboBoxDropDown_MBen {
  border-color: #c1dbfc;
  color: black;
  background: white;
  font: normal 12px/16px "Segoe UI", Arial, Helvetica, sans-serif; }
  .RadComboBoxDropDown_MBen .rcbHeader,
  .RadComboBoxDropDown_MBen .rcbFooter {
    color: black;
    background-color: #f1f5fb; }
  .RadComboBoxDropDown_MBen .rcbHeader {
    border-bottom-color: #c1dbfc; }
  .RadComboBoxDropDown_MBen .rcbFooter {
    border-top-color: #c1dbfc; }
  .RadComboBoxDropDown_MBen .rcbHovered {
    color: #1e395b;
    background: #eef6ff; }
  .RadComboBoxDropDown_MBen .rcbDisabled {
    color: #a7a7a7;
    background-color: transparent; }
  .RadComboBoxDropDown_MBen .rcbLoading {
    color: #1e395b;
    background: #eef6ff; }
  .RadComboBoxDropDown_MBen .rcbItem em,
  .RadComboBoxDropDown_MBen .rcbHovered em {
    color: #1e395b;
    background: #eef6ff; }
  .RadComboBoxDropDown_MBen .rcbCheckAllItems {
    color: black;
    background-color: #f1f5fb; }
  .RadComboBoxDropDown_MBen .rcbCheckAllItemsHovered {
    color: black;
    background-color: #f1f5fb; }
  .RadComboBoxDropDown_MBen .rcbMoreResults {
    border-top-color: #b8cbde;
    color: black;
    background-color: #f1f5fb; }
    .RadComboBoxDropDown_MBen .rcbMoreResults a {
      background-image: url('Common/radFormSprite.png');
      _background-image: url('Common/radFormSpriteIE6.png');
      background-position: -308px -181px; }
  .RadComboBoxDropDown_MBen .rcbSeparator {
    color: #ffffff;
    background: #8a8a8a; }

Please help.
MBEN
Top achievements
Rank 2
Veteran
 answered on 30 Jan 2014
1 answer
78 views
Dear all

I create Entity Framework then I insert my table to it (Employee)

I can retrieve all data in Employee table using the following :

public class WcfDataService : DataService<CRMSEntities>
{
    // This method is called only once to initialize service-wide policies.
    public static void InitializeService(DataServiceConfiguration config)
    {

        config.SetEntitySetAccessRule("*", EntitySetRights.AllRead);
        config.SetServiceOperationAccessRule("*", ServiceOperationRights.All);
    }
    [WebGet]
    public int GetCount(string where)
    {
        return  String.IsNullOrEmpty(where) ? CurrentDataSource.Employee.Count() :
          CurrentDataSource.Employee.Where(where).Count();
    }
}


Aspx code

<ClientSettings>
       <DataBinding Location="../WcfDataService.svc"  SelectCountMethod="GetCount">
                    <DataService TableName="Employee"/>
       </DataBinding>
</ClientSettings>


My question is if i want to retrieve employee by id or by name How can i do that?

also if this method of client side is fast way to retrieve data from DB or there is another methods?

Thanks
Jayesh Goyani
Top achievements
Rank 2
 answered on 30 Jan 2014
3 answers
41 views
Hi,

I tried to install TelerikControlPanelSetup_2013_4_1327.exe and get following error.

Could you help?

Thanks,

Dyanko
Telerik team
 answered on 30 Jan 2014
Narrow your results
Selected tags
Tags
+? more
Top users last month
Jay
Top achievements
Rank 3
Iron
Iron
Iron
Benjamin
Top achievements
Rank 3
Bronze
Iron
Veteran
Radek
Top achievements
Rank 2
Iron
Iron
Iron
Bohdan
Top achievements
Rank 2
Iron
Iron
Richard
Top achievements
Rank 4
Bronze
Bronze
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
Jay
Top achievements
Rank 3
Iron
Iron
Iron
Benjamin
Top achievements
Rank 3
Bronze
Iron
Veteran
Radek
Top achievements
Rank 2
Iron
Iron
Iron
Bohdan
Top achievements
Rank 2
Iron
Iron
Richard
Top achievements
Rank 4
Bronze
Bronze
Iron
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?