Telerik Forums
UI for ASP.NET AJAX Forum
1 answer
887 views

I used from the training book the delete command.  The problem that I am having is when I try to delete a record in the RadGrid, I get the following error:

Object referance not set to an instance of an object

The weird thing is I got it from the Telerik RadControls Ajax book and besides that I have no clue.  See attached code:

Imports System.Data.SqlClient  
Imports Telerik.Web.UI  
 
Partial Class EmployeeFamily  
    Inherits System.Web.UI.Page  
 
 
    Protected Sub RadGrid1_DeleteCommand(ByVal source As Object, ByVal e As Telerik.Web.UI.GridCommandEventArgs) Handles RadGrid1.DeleteCommand  
 
        Dim item As GridDataItem = DirectCast(e.Item, GridDataItem)  
        Dim MemberFamilyID As String = item.OwnerTableView.DataKeyValues(item.ItemIndex)("MemberFamilyID").ToString()  
        Try 
            'Delete command execute  
            SqlDataSource1.DeleteCommand = "DELETE FROM MemberFamilyInfo Where MemberFamilyID = '" + MemberFamilyID + "'" 
        Catch ex As Exception  
            RadGrid1.Controls.Add(New LiteralControl("Unable to delete MemberFamily. Reason: " + ex.Message))  
            e.Canceled = True 
        End Try 
 
 
 
    End Sub 
End Class 
 
Shinu
Top achievements
Rank 2
 answered on 23 Jul 2009
1 answer
394 views
I have an updateable radgrid for which I would like to use a static combo box as an edit control.
How do I bind the edit control to the grid column, and how will it be displayed when not in edit mode?

<

 

MasterTableView Width="100%" EditMode="InPlace"

 

<

 

telerik:GridDropDownColumn DropDownControlType="RadComboBox"

 


 

<telerik:RadComboBox ID="RadComboBox1" runat="server">

 

 

<Items>

 

 

<telerik:RadComboBoxItem Value="3" Text="Excellent" />

 

 

<telerik:RadComboBoxItem Value="2" Text="Good" />

 

 

<telerik:RadComboBoxItem Value="1" Text="Fair" />

 

 

<telerik:RadComboBoxItem Value="0" Text="Poor" />

 

 

<telerik:RadComboBoxItem Value="4" Text="N/A" />

 

 

</Items>

 

 

</telerik:RadComboBox>

 

Shinu
Top achievements
Rank 2
 answered on 23 Jul 2009
2 answers
48 views
Hey!

I've got a custom skin for a Panel Bar with each item's background image
as well as rollover image set in the skin file in CSS. However, what I need
is to set the images dynamically because each item is a product category
that has its own background image. I understand there's different ways
of doing this - and I'm also cautious of performance... Any advice and
examples much appreciated!!
Joe
Top achievements
Rank 1
 answered on 23 Jul 2009
2 answers
59 views
Hi! I have a problem. I'm using the RadGrid Control with Auto-Generate Columns at runtime, but i need adjust the every column to width the field ,How can I adjust the columns automatically?
Thanks for your help!

Bryan..



Brygom
Top achievements
Rank 1
 answered on 23 Jul 2009
2 answers
103 views
Hi,

when setting the filter attribute of the comboboxcontrol to one of the available types, i got a problem with assigned images.
The images where not shown in the generated dropdownbox. Not setting the filter shows all assigned images as wished.

Is this a known or volitional issue, or is this a bug?
I would like to see the images there, why is it not possible?

Or am i just doing something wrong?

Thanks for a short reply.
Mark P
Top achievements
Rank 1
 answered on 23 Jul 2009
5 answers
369 views
I am trying to setup a radwindow that will act as a modal and also have the background gray out while the window is open. I have edited the window css with the .TelerikModalOverlay property but this is not changing anything. On the page, I have a radwindowmanager with a window and modal="true". I have added the .RadWModalImage and setup a radalert and that works fine but can not get this to work with a standard radwindow. 


Jason Rodman
Top achievements
Rank 1
 answered on 23 Jul 2009
6 answers
310 views

Hi,

I have a grid pagination and I am displaying 25 items per page. If the user scrolls down and moves to the next/previous page, how can I reposition the scrollbar so the first item in the table gets visible? Should the grid do this automatically?

 
<div style="width:100%;height:100%">  
    <telerik:RadGrid  
        ID="RadGrid" 
        runat="server" 
        AllowPaging="true" 
        PageSize="25" 
        Width="100%" 
        Height="100%" 
        style="border:0px;outline:none" 
        > 
        <MasterTableView TableLayout="Auto" ClientDataKeyNames="Id, Icon, IsPrivate">  
            <Columns> 
                <telerik:GridBoundColumn DataField="Icon" HeaderText="" HtmlEncode="false" HeaderStyle-Width="26px"></telerik:GridBoundColumn> 
                <telerik:GridBoundColumn DataField="Name" HeaderText="Food" HtmlEncode="false" HeaderStyle-Width="100%"></telerik:GridBoundColumn> 
            </Columns> 
        </MasterTableView> 
        <ClientSettings EnableRowHoverStyle="true">  
            <Selecting AllowRowSelect="true" /> 
            <Scrolling AllowScroll="true" UseStaticHeaders="true" /> 
            <DataBinding Location="Grid.aspx" SelectMethod="Search" FilterParameterType="String" SortParameterType="String"></DataBinding> 
            <ClientEvents OnDataBinding="RadGrid_DataBinding" OnRowClick="RadGrid_RowClick" OnRowDblClick="RadGrid_RowDblClick" OnDataBound="RadGrid_DataBound" /> 
        </ClientSettings> 
        <PagerStyle Mode="Slider" /> 
    </telerik:RadGrid> 
</div> 
 


Thanks.

 

 

Teodorico
Top achievements
Rank 1
 answered on 22 Jul 2009
2 answers
183 views

Hi,

I have a Repeater inside a FormView in my page.I am creating a RadComboBox control programmatically and adding it to the Repeater.

protected

 

void DynamicFieldsRepeater_PreRender(object sender, EventArgs e)

 

{

      Repeater

 

repeater = (Repeater)sender;

 

      RadComboBox

 

comboBox = new RadComboBox();

 

      comboBox.ID =

"combo";

 

      comboBox.DataSourceID =

"ObjectDataSource2";

 

 

 

      comboBox.DataTextField =

"Name";

 

 

 

      comboBox.DataValueField =

"Id";

 

 

 

      repeater.Controls.Add(comboBox);

 

 

    //DropDownList d = new DropDownList();

 

 

    //d.ID = "dropdown";

 

    //d.DataSourceID =

"ObjectDataSource2";
    //d.DataTextField = "Name";
    //d.DataValueField = "Id";

 

 

 

   // repeater.Controls.Add(dropdown);

 

 

 

}

When I run the page I get this java script error:
'addEventListener' is null on not an object.

The thing is when I use DropDownList instead of RadComboBox,it works fine without error.
I am able to add RadDatePicker,RadTextBox,RadNumerticTextBox without the error, but not RadComboBox.
I am facing the same error when I use PlaceHolder instead of Repeater and try to add RadComboBox to to the placeholder programmatically.
Just to mention that I tried adding the controls in IntemCreated event of the repeater and the same error happend.

Thanks for your help.
Sima 

Sima Ganji
Top achievements
Rank 1
 answered on 22 Jul 2009
4 answers
145 views
Hi,
I have a page with a radgrid in it. Each time i click in a cell i put a textbox in the cell to edit the value.
The actual value of the cell is set in the textbox by default and after the user click in an other cell the textbox is appending to the new cell and set the new value in the old cell.
The problem is when i try to set the value of the textbox to 0 it always returning "". But i can set the value to 1 or more.

The textbox is using a radinputmanager to get the same property of a numerictextbox. Cause i can't append a radNumericTextBox to a specific cell in the grid. And in client side i use get_targetInput.

Is there anyway to be able to set_value() to 0 by the client side??

Thx and have a nice day!!!!

Guillaume
guillaume.lebel
Top achievements
Rank 1
Iron
Iron
 answered on 22 Jul 2009
2 answers
147 views
Hello

How would i create a master details grid where all of the details table are expanded on page load.

The details tables remain expanded permanently so I would also like to remove the expand/collapse column

thanks
andieje
Top achievements
Rank 1
 answered on 22 Jul 2009
Narrow your results
Selected tags
Tags
+? more
Top users last month
Tien
Top achievements
Rank 1
Iron
Krasimir
Top achievements
Rank 3
Bronze
Iron
Iron
Cedar
Top achievements
Rank 1
Iron
Emil
Top achievements
Rank 1
Iron
Kyle Watson
Top achievements
Rank 1
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
Tien
Top achievements
Rank 1
Iron
Krasimir
Top achievements
Rank 3
Bronze
Iron
Iron
Cedar
Top achievements
Rank 1
Iron
Emil
Top achievements
Rank 1
Iron
Kyle Watson
Top achievements
Rank 1
Iron
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?