Telerik Forums
UI for ASP.NET AJAX Forum
1 answer
84 views
Hello All,
In searching the various Telerik webpages outthere I found:
http://www.telerik.com/help/aspnet-ajax/grid-updating-inplace-and-editforms.html , that has examples on how to use the builtin edit form to edit a row in the grid...  I've tried to get my code as close as possible, but I'm not getting very far.  When it gets to the line:
e.Item.OwnerTableView.ExtractValuesFromItem(newValues, editableItem)
It give me an error of "NullReferenceException occurred"

Here is my page and the code behind as well:
<%@ Page Title="" Language="vb" AutoEventWireup="false" MasterPageFile="~/Site.Master" ValidateRequest="false"
    CodeBehind="AppSettings.aspx.vb" Inherits="AdminTools.AppSettings" MaintainScrollPositionOnPostback="true" %>
 
<%@ MasterType VirtualPath="~/Site.Master" %>
<%@ Register Assembly="Telerik.Web.UI" Namespace="Telerik.Web.UI" TagPrefix="telerik" %>
<asp:Content ID="Content1" ContentPlaceHolderID="ContentHeader" runat="server">
    <style type="text/css">
        .div
        {
            clear: both;
            padding: 5px;
        }
         
        .col1
        {
            float: left;
            width: 75%;
            background-color: #E1E1E1;
            min-height: 700px;
        }
         
        .col2
        {
            float: left;
            width: 20%;
            background-color: #EFEFEF;
            min-height: 700px;
            padding-left: 10px;
        }
         
        .row
        {
            clear: both;
            padding: 5px;
        }
         
        .cell
        {
            float: left;
            min-width: 200px;
            padding-right: 15px;
        }
    </style>
    <script type="text/javascript">
 
        function ShowNewForm(element) {
            var objElement = $get(element);
            if (objElement.style.visibility == "hidden") {
                objElement.style.visibility = "visible";
                objElement.style.display = "";
            }
            else {
                objElement.style.visibility = "hidden";
                objElement.style.display = "none";
            }
        }
 
    </script>
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="ContentPlaceHolder1" runat="server">
    <div id="PageMain">
        <div style="margin: 50px;">
            <div id="Applications" class="div">
                <div class="div">
                    Application:</div>
                <div>
                    <telerik:RadComboBox ID="cboApplication" runat="server" AutoPostBack="true" Width="200px">
                    </telerik:RadComboBox>
                </div>
            </div>
            <div id="Settings"  runat="server" class="div">
                <telerik:RadGrid
                    ID="dgvAppSettings" runat="server" skin="Outlook" AllowPaging="true" Pagesize="20"
                    AllowSorting="true"
                    AutoGenerateColumns="false"
                    OnNeedDataSource="dgvAppSettings_OnNeedDataSource"
                    OnItemCommand="dgvAppSettings_ItemCommand"
                    ShowStatusBar="true">
 
                    <ClientSettings EnableAlternatingItems="true" EnableRowHoverStyle="true" EnablePostBackOnRowClick="true"  >
                        <Selecting AllowRowSelect="true" />
                    </ClientSettings>
             
                    <MasterTableView
                        CommandItemDisplay="Bottom"
                        AutoGenerateColumns="false"
                        DataKeyNames="ID">
                        <Columns>
                            <telerik:GridEditCommandColumn AutoPostBackOnFilter="true" ButtonType="ImageButton" UniqueName="EditCommandColumn">
                            </telerik:GridEditCommandColumn>
                            <telerik:GridBoundColumn DataField="ID" HeaderText="ID" SortExpression="ID"
                                UniqueName="ID" Visible="false" MaxLength="5" ReadOnly="true">
                            </telerik:GridBoundColumn>
                            <telerik:GridBoundColumn DataField="AppID" HeaderText="AppID" SortExpression="AppID"
                                UniqueName="AppID" Visible="false" MaxLength="5">
                            </telerik:GridBoundColumn>
                            <telerik:GridBoundColumn DataField="SettingType" HeaderText="Setting Type"
                                UniqueName="SettingType" Visible="true" MaxLength="5">
                            </telerik:GridBoundColumn>
                            <telerik:GridBoundColumn DataField="SettingName" HeaderText="Setting Name"
                                UniqueName="SettingName" Visible="true" MaxLength="50">
                            </telerik:GridBoundColumn>
                            <telerik:GridBoundColumn DataField="SettingValue" HeaderText="Setting Value"
                                UniqueName="SettingValue" Visible="true">
                            </telerik:GridBoundColumn>
                        </Columns>
                        <EditFormSettings>
                            <EditColumn ButtonType="ImageButton" />
                        </EditFormSettings>
                    </MasterTableView>   
                </telerik:RadGrid>
                <asp:Label ID="Label1" runat="server" />
            </div>
        </div>
    </div>
</asp:Content>

and here is my code behind for the update event:
Protected Sub dgvAppSettings_UpdateCommand(sender As Object, e As Telerik.Web.UI.GridCommandEventArgs) Handles dgvAppSettings.UpdateCommand
    Dim editableItem = (DirectCast(e.Item, GridEditableItem))
 
    Dim SettingsTable As DataTable = Me.GridSource
    Dim changedRows As DataRow() = SettingsTable.Select("ID = " + editableItem.OwnerTableView.DataKeyValues(editableItem.ItemIndex)("ID").ToString())
    If changedRows.Length <> 1 Then
        e.Canceled = True
        Return
    End If
 
    Dim newValues As New Hashtable()
    ' ***
    ' It get past the "Dim of newValues..." just fine... however, on the next line it give me the error...
    ' ***
    e.Item.OwnerTableView.ExtractValuesFromItem(newValues, editableItem)
     
    changedRows(0).BeginEdit()
    Try
        For Each entry As DictionaryEntry In newValues
            changedRows(0)(DirectCast(entry.Key, String)) = entry.Value
        Next
        changedRows(0).EndEdit()
    Catch ex As Exception
        changedRows(0).CancelEdit()
        e.Canceled = True
    End Try
 
    Label1.Text += " Table to be updated: " + e.Item.OwnerTableView.DataMember + "<br>"
 
End Sub

OK all,  Any Ideas as to what the heck I'm doing wrong????  
as a caveat, I'm a total "Newbie" at the telerik controls, and it's been a long time since I've done any ASP programming, like back before ASP.Net, yes back in the classic days...

Thanks in advance,

Kevin Orcutt
Kevin.Orcutt@MatsomMoney.com

Angel Petrov
Telerik team
 answered on 31 Oct 2013
1 answer
76 views
Any ETA when the other 30 controls will be included in the Visual Style Builder?
Rumen
Telerik team
 answered on 31 Oct 2013
20 answers
602 views
I am going to use Radscheduler for the first time.Basically I need to customize my insert/edit window,do some programming in the code behind while inserting/updating(using sql datasource) an appointment.Also I need to have additional buttons and textbox controls in the insert/edit window.I have gone through all the demos and understood direct insert/update/delete from the markup using sql datasource.But for the server side programming,I am totally confused with the demos and tutorials .
I need to know if I can handle the scheduler also in the same manner as other telerik controls like radgrid and use the server side events as for a normal aspx page for the insert/edit form.

I need to do the insert/update in the code behind.Before inserting I need to calculate the appointment number,also need to fetch registration id from the another table.While insert in appointment table,I need to check if appointment exist  at that time of the day.If yes,need to show error message and save should not happen.

I am totally confused as how to do the save process in the code behind instead of using  <InsertParameters> / <UpdateParameters> in the markup and using below code in the code behind.
protected void RadScheduler1_AppointmentInsert(object sender, SchedulerCancelEventArgs e)
{
  Appointments.Add(new AppointmentInfo(e.Appointment));
}
Can I do the above process in a buttonclick event where I can do all the calculations,insert/update the database
 and bind the scheduler?
Also,If I am customizing the popup window/Insert form,do I need to do as in 
http://demos.telerik.com/aspnet-ajax/scheduler/examples/advancedformtemplate/defaultcs.aspx in order to have the recurrence 
reminder or should I use a raddock for the same ?

Please guide me on this asap.Sample code for the same if any,would be highly appreciable.
Thanks,
Soumya.
Plamen
Telerik team
 answered on 31 Oct 2013
3 answers
161 views
I would like to upload the selected files directly to the server without requiring the user to make a postback. The client side file upload should be followed by upload to server automatically. Also I dont want to use a Generic handler. How can I accomplish this?

Any input appreciated
Antony
Shinu
Top achievements
Rank 2
 answered on 31 Oct 2013
2 answers
113 views
Hi

Just thinking out loud here, I have a radComboBox with a tree view inside, We have to add another selection criteria on an already busy form, I'm wondering if its possible to put a few (only 3-4) checkboxes above the tree view all enclosed in a RadCombobox. The tree view would be populated based on which check box was selected.

Andy
Andy Green
Top achievements
Rank 2
 answered on 31 Oct 2013
1 answer
59 views
Hi, I have a performance problem whit multicell selection in ie8... It is very slow, furthermore if a cell contains a radtexbox The application gets frozen when i focus it. However The problem disappears in IE10 or if i don't set The selection mode. Thanks
Pavlina
Telerik team
 answered on 31 Oct 2013
5 answers
1.0K+ views
If the width of some dropdown menu items exceed the width of RadCombox, how to expand dropdown menu in that case all menu items will be shown?
Princy
Top achievements
Rank 2
 answered on 31 Oct 2013
1 answer
145 views
Hi Experts,

From client code, is it possible to check if my web page containing radcontrols are viewed in a handheld device such as IPAD, smartphones? If its a handheld device, I want to show the user a page optimized for mobile view.

Thanks
Henry
Princy
Top achievements
Rank 2
 answered on 31 Oct 2013
3 answers
110 views
Hello,

I have enabled a customer provider and am successfully populating the tree from a database. The problem I am having is that I can't show the new folder button and the upload button is showing, but disable. How do I enable those 2 buttons?

Also when I right click on a folder, the entire menu is disabled.

THanks
Thomas
Vessy
Telerik team
 answered on 31 Oct 2013
6 answers
803 views
Hello,

I have a very simple table called Lokacije that has two columns. First one is IdLokacije (autonumber) and 2nd one is description of Location with name NazivLokacije.
Second table named Uredjaji, has a column that is foreign key of Lokacija named Lokacije.
Table: Uredjaji
    foreign key: Lokacija
Table: Lokacije
    primary key: IdLokacije (int)
    column desc: NazivLokacije
In my grid (that has datasource through SQLDataSource to Uredjaji) i have GridDropDownColumn, that is bound to Lokacija.
Everything works well, i have in edit mode dropdown list showing me NazivLokacije as DisplayValue it is bound to idLokacije.
When i want to group using Lokacija column, i am getting field IdLokacije showing me numbers, and i want to show friendly name NazivLokacije.
So my question is, how to change default grouping column display value from idLokacije to NazivLokacije?
Below is copy code of my GridDropDownColumn and also picture that should explain better

Thank you in advance
<telerik:GridDropDownColumn ColumnEditorID="GridDropDownColumnEditor1" DataField="Lokacija" DataSourceID="SqlDataSourceLokacija" DataType="System.Int64" HeaderText="Lokacija" ListTextField="NazivLokacije" ListValueField="idLokacije" UniqueName="ColumnLokacija" >                      
    <FilterTemplate>
         <telerik:RadComboBox ID="ColumnLokacija" runat="server" AppendDataBoundItems="true" DataSourceID="SqlDataSourceLokacija" DataTextField="NazivLokacije" DataValueField="idLokacije" Height="200px" OnClientSelectedIndexChanged="TitleIndexChanged" SelectedValue='<%# TryCast(Container, GridItem).OwnerTableView.GetColumn("ColumnLokacija").CurrentFilterValue%>'>
              <Items>
                 <telerik:RadComboBoxItem Text="All" />
              </Items>
         </telerik:RadComboBox>
         <telerik:RadScriptBlock ID="RadScriptBlock1" runat="server">
          <script type="text/javascript">
                 function TitleIndexChanged(sender, args) {
                    var tableView = $find("<%# TryCast(Container,GridItem).OwnerTableView.ClientID %>");
                    tableView.filter("ColumnLokacija", args.get_item().get_value(), "EqualTo"); }
          </script>
         </telerik:RadScriptBlock>
     </FilterTemplate>
</telerik:GridDropDownColumn>

 

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