Telerik Forums
UI for ASP.NET AJAX Forum
4 answers
82 views
Hello,

I am using a RadGrid and I am binding an Arraylist of type "myClass" (name property, id Property and several boolean properties).  I am using this arrayList as my datasource for the grid and I am using checkbox columns for the boolean properties.

public interface IMyClass
    {     
           int EntityID{get; set; }
        string Name { get; set; }
        bool IsPrivateReader { get; set; }
        bool CanShare { get; set; }
    }

The issue I am having is that when I check a checkbox it does not update the object it is bound to.  Please help.  Here is my grid:

<telerik:RadGrid ID="dg" 
                             runat="server" 
                             AllowSorting="True" 
                             AllowAutomaticUpdates="True"
                             Skin="WebBlue" 
                             EnableAJAX="true" 
                             EnableOutsideScripts="true" 
                             GridLines="None">
             <ClientSettings>
                 <Selecting CellSelectionMode="None" />
             </ClientSettings>
             <MasterTableView AllowAutomaticDeletes="true" AutoGenerateColumns="False" 
                 CommandItemDisplay="None" DataKeyNames="EntityID" Width="100%">
                 <CommandItemSettings ExportToPdfText="Export to PDF" />
                 <RowIndicatorColumn>
                     <HeaderStyle Width="20px" />
                 </RowIndicatorColumn>
                 <ExpandCollapseColumn>
                     <HeaderStyle Width="20px" />
                 </ExpandCollapseColumn>
                 <Columns>
                       
                     <telerik:GridBoundColumn DataField="EntityID" HeaderStyle-HorizontalAlign="Center" HeaderText="Entity ID" ItemStyle-HorizontalAlign="Left" SortExpression="EntityID">
                         <HeaderStyle HorizontalAlign="Center" />
                         <ItemStyle HorizontalAlign="Left" />
                     </telerik:GridBoundColumn>
                     <telerik:GridBoundColumn DataField="Name" HeaderStyle-HorizontalAlign="Center" HeaderText="Name" ItemStyle-HorizontalAlign="Left" SortExpression="Name">
                         <HeaderStyle HorizontalAlign="Center" />
                         <ItemStyle HorizontalAlign="Left" />
                     </telerik:GridBoundColumn>
                     <telerik:GridTemplateColumn headertext="Private Reader" uniquename="PrivateReaderColumn">
                         <itemtemplate>
                             <asp:CheckBox ID="cbxPrivateReader" runat="server" checked='<%# Eval("IsPrivateReader") %>' />
                         </itemtemplate>
                         <edititemtemplate>
                             <asp:CheckBox ID="cbxPrivateReader" runat="server" checked='<%# Bind("IsPrivateReader") %>' />
                         </edititemtemplate>
                     </telerik:GridTemplateColumn>
                     <telerik:GridTemplateColumn headertext="Share" uniquename="SharedColumn">
                         <itemtemplate>
                             <asp:CheckBox ID="cbxShare" runat="server" checked='<%# Eval("CanShare") %>' />
                         </itemtemplate>
                         <edititemtemplate>
                             <asp:CheckBox ID="cbxShare" runat="server" checked='<%# Bind("CanShare") %>' />
                         </edititemtemplate>
                     </telerik:GridTemplateColumn>
                     <telerik:GridTemplateColumn AllowFiltering="true" HeaderText=" " 
                         Reorderable="true" ShowSortIcon="true" SortExpression="Name">
                         <ItemTemplate>
                             <asp:ImageButton ID="btnDelete" runat="server" CausesValidation="False" 
                                 CommandName="DeleteSelected" ImageUrl="~/Images/Delete.gif" 
                                 OnClientClick="return GetUserConfirmForItemDelete(event);" 
                                 ToolTip="Delete Record" />
                         </ItemTemplate>
                     </telerik:GridTemplateColumn>
                 </Columns>
                 <EditFormSettings>
                     <EditColumn FilterControlAltText="Filter EditCommandColumn column">
                     </EditColumn>
                 </EditFormSettings>
             </MasterTableView>
             <FilterMenu EnableTheming="True" Skin="WebBlue">
                 <CollapseAnimation Duration="200" Type="OutQuint" />
             </FilterMenu>
         </telerik:RadGrid>

This is my datasource:

protected void Page_Load(object sender, EventArgs e)
        {
            if(!Page.IsPostBack)
            {
                ViewState["DataSource"]  = new ArrayList();
                SetInitialJavaScriptFunctions();
            }
        }
  
        private ArrayList DataSource { get { return (ArrayList)ViewState["DataSource"]; }


private

 

 

void BindDataGrid(string strSortExpression = "", SortDirection eSortDirection = SortDirection.Ascending)

 

{

     dg.DataSource = DataSource;

     dg.DataBind();

}


What am I missing?

Thanks
Dan Harvey
Top achievements
Rank 2
 answered on 19 Mar 2012
1 answer
109 views
I am using multiple RadComboBoxes to cascade selectable values. I am using the OnClientDropDownClosed client-side event to  fire the server-side ItemsRequested event to populate the next combobox in my sequence. Data for each combobox loads properly, but if I set the EnableCheckAllItemsCheckBox property to true, when I select the next combobox and before the ItemsRequested server-side event fires, I receive the following error:

"Microsoft JScript runtime error: 'this.get_checkAllCheckBoxDivElement().0.offsetHeight' is null or not an object"

Does anyone have any ideas how I can make all of these parts work together?

Thanks for any help.....
Kalina
Telerik team
 answered on 19 Mar 2012
1 answer
75 views
Hi, I have just upgraded to the last asp.net ajax Q1 2012.215, but now I have some problem with the image editor inside to the radeditor.

With the Q3 2011 version everything was working well, but with the new version when I call Image editor from radeditor, the image it is not shown.

It is something like that the Image name is not set, infact if I click on refresh button I will get error because there is not any name on image reference.

It is changed somenthing from Q3 2011? because I can't find any solution to solve this problem.
fforna
Top achievements
Rank 2
 answered on 19 Mar 2012
3 answers
79 views
I am attempting to use the method outlined in this article to access controls defined in an InPlace editor, but have thus far not been able to get it to work. What I'd like to do is to use the value from one RadDatePicker to populate another RadDatePicker. The <script> block appears as it should but, when the event handler is called, the variables are both null.

ASP.Net:
<EditItemTemplate>
    <telerik:RadDatePicker runat="server" ID="txtBidDepartDate" Width="90px" DateInput-DateFormat="ddMMMyy" ClientEvents-OnDateSelected="setBidDate"
        SelectedDate='<%# (Eval("departtime").ToString().Length > 0) ? DateTime.Parse(Eval("departtime").ToString()) : DateTime.Now %>' />
    <telerik:RadMaskedTextBox runat="server" ID="txtBidDepartTime" Width="45px" Mask="##:##" Style="text-align:center;"
        Text='<%# (Eval("departtime").ToString().Length > 0) ? DateTime.Parse(Eval("departtime").ToString()).ToString("HH:mm") : "" %>' />
    <asp:RequiredFieldValidator runat="server" ID="validateTxtBidDepartDate" ControlToValidate="txtBidDepartDate" EnableClientScript="true"
        ErrorMessage="Departure Date is required." ValidationGroup="gridBids" Display="Dynamic" />
    <script language="javascript" type="text/javascript">
        departDateObj = $find('<%# Container.FindControl("txtBidDepartDate").ClientID %>');
    </script>
</EditItemTemplate>

JavaScript:
var departDateObj,arriveDateObj;
function setBidDate (sender, args) {
    if (!departDateObj || !arriveDateObj) return false;
 
    if (!arriveDateObj.isEmpty()) return false;
 
    arriveDateObj.set_selectedDate(departDateObj.get_selectedDate());
}
Vasil
Telerik team
 answered on 19 Mar 2012
4 answers
108 views
I am using a RadRotator control to display a series of images, and each image has a unique target URL that the user is to be redirected to when clicked.

What I encountering is that the ImageButton contains the properties of the last image in the Rotator. When I look at the sender object in the code-behind, the ImageURL and AlternateText property are set to the last image loaded into the Rotator, not the values of the image I clicked.

How can I get this to work ?? I was using a asp:Hyperlink control initially in the RadRotator, but the same problem was occuring.


Here is my code:


                        <telerik:RadRotator ID="RadRotator1" runat="server" DataSourceID="SqlDataSourceHomeImages" FrameDuration="4000" RotatorType="AutomaticAdvance"  >
                            <ItemTemplate>
                                    <asp:ImageButton ID="btnHomePage" runat="server" ImageUrl='<%# "images/" & Eval("hpi_image")%>'  AlternateText='<%# Eval("hpi_URL") %>' OnClick="btnHomePage_Click"/>
                                      </ItemTemplate>
                        </telerik:RadRotator>

                        <asp:SqlDataSource ID="SqlDataSourceHomeImages" runat="server" ConnectionString="<%$ ConnectionStrings:WebDB_string.com%>"
                                SelectCommand="SELECT hpi_image, hpi_URL, hpi_external FROM tbl_HomeImages WHERE hpi_show_on_web = 'True' ORDER BY hpi_sort_order">
                        </asp:SqlDataSource>

And here is the Click event from the code-behind:

   Protected Sub btnHomePage_Click(sender As Object, e As System.Web.UI.ImageClickEventArgs)

        Response.Redirect(sender.AlternateText)

    End Sub

Very simple, and it should work. But it doesn't and it's driving me crazy !!

Thanks !

Bruce

Bruce
Top achievements
Rank 1
 answered on 19 Mar 2012
1 answer
99 views
Hello,
I would like to make an ImageRotator that display a picturs existe in a sqlserver database without using a webservice, how can i do it step by step please  ?
Thankx

Slav
Telerik team
 answered on 19 Mar 2012
0 answers
67 views
Hi ,
I have the requirement that the position of check boxes remain in the same column for parent and child node .
Generaaly check boxes will come with child node with the indent space . I want the child node to appear at the indent
space but the check boxes should come without indent . It mean that all check boxes will come at same x location ( same column ) .
Please help me how it can be achieved in telerik control ?

Checkbox  root
checkbox         Parent
checkbox                child 1
checkbox                child 2
checkbox                child 2
checkbox                      child4

Position of child nodes are same but checkboxes should not appear just before them . They should be
in the 1st colimn itself . Hope this illustration is clear .


Thanks ,
Kaushik Vatsa
Kaushik
Top achievements
Rank 1
 asked on 19 Mar 2012
1 answer
472 views
This is the scenario:
I have a RadGrid, in which each row will have a
"GenName(String), Status(RadComboBox), Type(RadComboBox)"
The ClientDataKeyNames are "ID, GenName"

I am doing a CLIENT SIDE BINDING USING A WCF SERVICE for the RadGrid.

Once the data is bound to the radgrid, I will have to click on the "Type" RadComboBox. It has to use Load on Demand. But the data that will be shown in the RadComboBox depends on the ID (ClientDataKeyName) of that particular row. How do I access it??

presently I am using "onclientitemsrequesting" event and below is the even handler,

function GetGenerationVersions(sender, eventArgs) {
                 
                var filterString = eventArgs.get_text();
 
                var rcbElement = sender.get_element();
                // var parentRowID = $(rcbElement).parents("tr").first().prev("tr.rgRow, tr.rgAltRow")[0].id;
                var genID = sender.get_element().parentNode.parentNode.getDataKeyValue("ID");
 
                //.get_parent().get_parent().get_masterTableView().get_dataItems()[0].getDataKeyValue("GenerationID");
                alert(genID.toString());
                var context = eventArgs.get_context();
                context["FilterString"] = filterString;
 
                context["SiteID"] = document.getElementById("<%=lblSiteID.ClientID %>").innerText;
                context["ProductID"] = $find('<%=rcbProducts.ClientID %>').get_selectedItem().get_value();
                context["GenerationName"] = genID;
 
            }

It throws me an Error :  Object doesn't support property or method 'getDataKeyValue'

Please let me know how to deal with it.
Thanks.

Yash

"
Vasil
Telerik team
 answered on 19 Mar 2012
1 answer
94 views
I need to add Radupload control as one of the RadMenu items.
When i add Radupload under RadMenu items, it renders it as a button in menu, I want it to look like a linkbutton.
Other approach seems like Radupload needs to be invisible but trigger it on click of a linkbutton through javascript.
Is that possible?Can you let me know what approach is suitable to achieve this?
Peter Filipov
Telerik team
 answered on 19 Mar 2012
0 answers
59 views
Hi,

I have a requirement like, when we type any person name its has to suggest person names along with email, it is like 2 level sugsestion.
It is like menu type structure

For ex:

If i type Mahsesh it has to suggest all names start with mahesh along with email id's in next level. Please find attached file

It will be helpful, if you can provide the code which supports this feature.

Regards
Patil B V

Patil
Top achievements
Rank 1
 asked on 19 Mar 2012
Narrow your results
Selected tags
Tags
+? more
Top users last month
Rob
Top achievements
Rank 3
Iron
Iron
Iron
Atul
Top achievements
Rank 1
Iron
Iron
Alexander
Top achievements
Rank 1
Veteran
Iron
Serkan
Top achievements
Rank 1
Iron
Shawn
Top achievements
Rank 1
Iron
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
Rob
Top achievements
Rank 3
Iron
Iron
Iron
Atul
Top achievements
Rank 1
Iron
Iron
Alexander
Top achievements
Rank 1
Veteran
Iron
Serkan
Top achievements
Rank 1
Iron
Shawn
Top achievements
Rank 1
Iron
Iron
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?