Telerik Forums
UI for ASP.NET AJAX Forum
2 answers
90 views
Hello, I have a radgrid that is being populated with a mysql odbc datasource. I am trying to get the update command to update information from my edited item to the database. as of right now, if you click edit, the item goes into edit mode. if you add text then click update, it postsback, but no data is loaded to the database. I need this to work as an itemCommand "Update" in a select case as I need to dynamically populate data to be added through another function. I have tried using just a standard "OnUpdate" but that also is not working. here is the offending code, HELP PLEASE 




*****Previous Code*****

  Protected Sub gridfflistings_UpdateCommand(ByVal sender As Object, ByVal e As Telerik.Web.UI.GridCommandEventArgs)
        Dim editedItem As GridEditableItem = CType(e.Item, GridEditableItem)
        Dim rowid As String = gridfflistings.MasterTableView.DataKeyValues(e.Item.ItemIndex)("propertyid")
        Dim Dlink As String = editedItem("txtlink").Text
        Dim add1 As String = editedItem("address").Text
        Dim propid As String = rowid.ToString
        Dim upstr As String = "update fflistings set mlsnumber=?, directlink=? where propertyid=?;"
        Dim upcon As New OdbcConnection(sConnectionString)
        upcon.Open()
        Using upcom As New OdbcCommand(upstr, upcon)
            upcom.Parameters.AddWithValue("mlsnumber", "11111")
            upcom.Parameters.AddWithValue("directlink", Dlink.ToString)
            upcom.Parameters.AddWithValue("propid", rowid.ToString)
            Try
                upcom.ExecuteNonQuery()
                gridfflistings.Rebind()
                lbldebug.Text = " updated information"
                upcon.Close()
            Catch ex As Exception
                lbldebug.Text = "There was an issue updating the db" & ex.Message
            End Try
        End Using
    End Sub



******the grid*****

<telerik:radgrid id="gridfflistings" datasourceid="sqlfflistings" runat="server" width="800px" OnUpdateCommand="gridfflistings_UpdateCommand" AllowAutomaticUpdates="false">                
                <MasterTableView DataSourceID="sqlfflistings" DataKeyNames="propertyid" AutoGenerateColumns="false" EditMode="EditForms" >
                <columns>
                <telerik:GridEditCommandColumn ButtonType="ImageButton" >               
                </telerik:GridEditCommandColumn>               
                <telerik:GridBoundColumn HeaderText="Property ID" datafield="propertyid" readonly="true" visible="true"></telerik:GridBoundColumn>
                <telerik:GridBoundColumn HeaderText="Address" datafield="address1" uniquename="address" readonly="true"></telerik:GridBoundColumn>
                <telerik:GridBoundColumn HeaderText="City" datafield="city" readonly="true"></telerik:GridBoundColumn> 
                <telerik:GridBoundColumn HeaderText="State" DataField="state" readonly="true"></telerik:GridBoundColumn>
                <telerik:GridBoundColumn HeaderText="Zip Code" DataField="Zipcode" readonly="true"></telerik:GridBoundColumn>
                <telerik:GridBoundColumn HeaderText="M6P ID" DataField="m6plistingid" readonly="true"></telerik:GridBoundColumn>
                <telerik:GridBoundColumn HeaderText="MLS" DataField="mlsnumber" ReadOnly="true" ></telerik:GridBoundColumn>
                <telerik:GridBoundColumn HeaderText="Direct Link" DataField="directlink" UniqueName="directlink" ColumnEditorID="newlink" Visible="false" ReadOnly="true"></telerik:GridBoundColumn>
                <telerik:GridTemplateColumn UniqueName="newlink" headertext="Direct Link">
                    <ItemTemplate>
                        <asp:Label ID="lbllink" runat="server"></asp:Label>
                    </ItemTemplate>
                    <EditItemTemplate>
                        <asp:TextBox ID="txtlink" runat="server"></asp:TextBox>
                    </EditItemTemplate>
                </telerik:GridTemplateColumn>
                <telerik:GridCheckBoxColumn HeaderText="Paid" DataField="pstatus" readonly="true"></telerik:GridCheckBoxColumn>
                </columns>
                </MasterTableView>
                </telerik:radgrid>

I have changed the code as follows to try and use a custom edit form to see if that would fix the issue. I have done some testing and it is updating data to the db, it is just NOT capturing the data from the edit form. It keeps applying a &nbsp; to the db instead of the values needed. I have altered the code above to the new code, PLEASE HELP! I have to get this function finished TODAY!!!!!!  now when I click the update button it does not leave edit mode. 
Iana Tsolova
Telerik team
 answered on 06 Jun 2011
1 answer
119 views
i have a radtextbox

 <telerik:RadTextBox ID="rtbItemDescription" runat="server" TabIndex="1050"
                                            MaxLength="<%$ Resources:ItemResources,rtbItemDescriptionMaxLength %>"
                                            Width="<%$ Resources:ItemResources,rtbItemDescriptionWidth %>"  
                                            TextMode="MultiLine" Rows="<%$ Resources:ItemResources,rtbItemDescriptionRows %>"                                        
                                             ontextchanged="rtbItemDescription_TextChanged" >
                                        </telerik:RadTextBox>


from resource  file rtbItemDescriptionMaxLength ="160"
                             rtbItemDescriptionWidth ="150"
                            rtbItemDescriptionRows="3"
when i save data by clicking radbutton
control goes to this line in javascript file
b._textBoxElement.select(); error occurs "microsoft javascript error invalid function"
Martin
Telerik team
 answered on 06 Jun 2011
2 answers
106 views
hy everyone , i'm still a noob at telerik controls , i have a project and i want to use the RadScheduler , i used it with a database witch got a table named event(id,text,de(start),a(end)), it works , i mean it shows the events , but just shows , i cant delete , drag or create , and i really dont have an idea how to do , plz if u can help me :S
Plamen
Telerik team
 answered on 06 Jun 2011
3 answers
408 views

How i find in radcombobox in javascript tag ,

<telerik:RadCodeBlock runat="server" ID="radCodeBlock">
        <script type="text/javascript">
            function onSelectedIndexChanged(sender, eventArgs) {
                debugger;
                updateComboBox(sender);
            }

            function updateComboBox(listBox) {
                var text = "";
                var value = "";
                var items = listBox.get_selectedItems();

                for (var i = 0; i < items.length; i++) {
                    var item = items[i];

                    //Check whether the Item's 'selected' attribute is set to true.
                    if (item.get_selected()) {
                        text += item.get_text() + ", ";
                        value += item.get_value() + ", ";
                    }
                }

                text = text.substring(0, text.length - 2);
                value = value.substring(0, value.length - 2);

                var comboBox = $find("ComboBox_SortColumn");

                //Set the text of the RadComboBox to the texts of the selected Items, separated by ','.
                comboBox.set_text(text);

                //Set the value of the RadComboBox to values of the selected Items, separated by ','.
                comboBox.trackChanges();
                comboBox.get_items().getItem(0).set_value(value);
                comboBox.commitChanges();
            }

        </script>
    </telerik:RadCodeBlock>



<EditFormSettings CaptionFormatString="Create" EditFormType="Template">

  <td>
                                                                        <asp:Label ID="Label15" runat="server">Selected</asp:Label>
                                                                        <telerik:RadListBox runat="server" DataTextField="Text" DataValueField="Value" ID="RadListBoxDestinationGroup"
                                                                            AutoPostBackOnReorder="true" EnableDragAndDrop="true" AllowReorder="true" Height="140px"
                                                                            Width="160px" ButtonSettings-Position="Left" OnClientSelectedIndexChanged="onSelectedIndexChanged">
                                                                        </telerik:RadListBox>
                                                                    </td>

<td>
                                                        <telerik:RadComboBox ID="ComboBox_SortColumn" runat="server" Width="175px" SelectedValue='<%# Bind("SortColumn") %>'
                                                            AllowCustomText="true">
                                                            <Items>
                                                                <telerik:RadComboBoxItem Text="" />
                                                            </Items>
                                                        </telerik:RadComboBox>
                                                    </td>
<EditFormSettings/>



Thanks,
Mohamed.
Iana Tsolova
Telerik team
 answered on 06 Jun 2011
1 answer
148 views
Is it possible to output the following to a RadGrid rather than just the page?

Protected Sub Button1_Click(sender As Object, e As System.EventArgs) Handles Button1.Click
    Dim newPaswordSecureString As System.Security.SecureString = New System.Security.SecureString()
    Dim newPassword As String = "password"
    For Each c As Char In newPassword
        newPaswordSecureString.AppendChar(c)
    Next
    Dim credential As PSCredential
    credential = New PSCredential("userame", newPaswordSecureString)
    'Set the connection Info
    Dim connectionInfo As WSManConnectionInfo = New WSManConnectionInfo(New Uri("http://tusdcas1.tusd.local/powershell"), "http://schemas.microsoft.com/powershell/Microsoft.Exchange", credential)
    Dim runspace As Runspace = System.Management.Automation.Runspaces.RunspaceFactory.CreateRunspace(connectionInfo)
    runspace.Open()
    Dim newMbx As Command
    newMbx = New Command("Get-MailboxStatistics")
    newMbx.Parameters.Add("Server", "TUSDMBSTORAGE1.tusd.local")
    Dim cmd As Pipeline = runspace.CreatePipeline()
    cmd.Commands.Add(newMbx)
    Dim commandResults As Collection(Of PSObject)
    commandResults = cmd.Invoke()
    For Each cmdlet As PSObject In commandResults
        Dim _cmdletDisplayName As String = cmdlet.Properties("DisplayName").Value.ToString()
        Dim _cmdletTotalItemSize As String = cmdlet.Properties("TotalItemSize").Value.ToString()
        Dim _cmdletLegacydn As String = cmdlet.Properties("LegacyDN").Value.ToString()
        Response.Write("Mailbox No.:" + _cmdletDisplayName + "," + _cmdletTotalItemSize + "," + _cmdletLegacydn)
    Next
End Sub

Thank you.
Hus Damen
Top achievements
Rank 1
 answered on 06 Jun 2011
1 answer
39 views
Is there a way to retain sort of grid across post backs & page redirections?

Thank you

Regards
Raj
Shinu
Top achievements
Rank 2
 answered on 06 Jun 2011
3 answers
156 views
Hi, 

    When i select a filter in the RadGrid send me an error here:

        Telerik.Web.UI.GridTableView.registerClass(

"Telerik.Web.UI.GridTableView",Sys.UI.Control);

 

        Telerik.Web.UI.GridFilterFunction=

function(){};

 

        Telerik.Web.UI.GridFilterFunction.prototype= {NoFilter:0,Contains:1,DoesNotContain:2,StartsWith:3,EndsWith:4,EqualTo:5,NotEqualTo:6,GreaterThan:7,LessThan:8,GreaterThanOrEqualTo:9,LessThanOrEqualTo:10,Between:11,NotBetween:12,IsEmpty:13,NotIsEmpty:14,IsNull:15,NotIsNull:16,Custom:17};

        Telerik.Web.UI.GridFilterFunction.registerEnum(

"Telerik.Web.UI.GridFilterFunction",false);

 

        Telerik.Web.UI.GridFilterFunction.parse=

function(b,a){return(typeof b=="number")?b:Sys$Enum$parse.call(this,b,!!a);

    Sys$Enum$parse is not defined

thank you for your help.

 

Iana Tsolova
Telerik team
 answered on 06 Jun 2011
1 answer
51 views
We are currently using an older version of RadGrid (4.0.1.0) in our application and I have noticed that the javascript being used access the MasterTableView is no longer working in FF4.0.1. It was working fine in FF3.5

The script in question looks the same as your samples:
function ShowEditForm(id, rowIndex) {
    var grid = window["<%= grd.ClientID %>"];
    var rowControl = grid.MasterTableView.Rows[rowIndex].Control;               
    grid.MasterTableView.SelectRow(rowControl, true);
    return ShowPopup("<%= GetUrl() %>" + id);
}

The same code works fine in IE8. In FF4, Firebug reports the variable 'grid' as Object { } and grid.MasterTableView is undefined. Under FF3.5, the variable 'grid' is listed as Object { Type="RadGrid" }

Any ideas how to fix this without upgrading the Rad controls?

Regards
Alan
Hus Damen
Top achievements
Rank 1
 answered on 06 Jun 2011
1 answer
181 views
I have a grid bound to a dynamic view. I am using the NeedDataSource and have the AutoGenerateColumns set to true because I never know what the column headers or count will be.

I have AllowFiltering set to true to allow users to work with the returned data. There are a couple of column settings I would like to apply to all columns and I am hoping to avoid writing a bunch of code in the PreRender event and then rebinding.

I would like to set the default filter (CurrentFilterFunction) to "StartsWith" and not "Contains" for all columns.
I would like to set the default FilterControlWidth to be the same width for all columns. I noticed that string columns are one size and numeric columns are another (larger?).

I've serched through the forums but can't find anything. If someone can provide a link or a suggestion that would be great.
 
Thanks,
Craig
Princy
Top achievements
Rank 2
 answered on 06 Jun 2011
1 answer
76 views
Hi,

I am having some issues when a grid is in edit/insert mode because the
web user control used to edit the data does not render properly.  The labels
of the form are not displayed (They are invisible) and when you type something
in the text boxes the characters are not displayed.

One additional thing is that a pop window is opened and inside the popup window
a user control is rendering a grid. That grid opens a popup window when it is 
in edit/insert mode. So, the escenario is a form, with a popup window that opens 
another popup window. 

The issue is happening only in Internet Explorer version 8.  Now most of the users
of the company are using this version.

we tested the form with Internet Explorer 9, Google Chrome (Latest version) and Firefox (Latest version) and it works fine.

I attached two screenshots. One shows the problem, and the other one renders fine.
(I.E 9, Google Chrome, Firefox).

The easiest way to fix it is to upgrade the I.Explorer, but for now what should be the
best way to fix it momentarily.

Regards,

Leonardo Vega.
Tsvetina
Telerik team
 answered on 06 Jun 2011
Narrow your results
Selected tags
Tags
+? more
Top users last month
Top achievements
Rank 1
Iron
Iron
Iron
Rob
Top achievements
Rank 3
Bronze
Bronze
Iron
ivory
Top achievements
Rank 1
Iron
Nurik
Top achievements
Rank 2
Iron
Iron
YF
Top achievements
Rank 1
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
Top achievements
Rank 1
Iron
Iron
Iron
Rob
Top achievements
Rank 3
Bronze
Bronze
Iron
ivory
Top achievements
Rank 1
Iron
Nurik
Top achievements
Rank 2
Iron
Iron
YF
Top achievements
Rank 1
Iron
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?