Telerik Forums
UI for ASP.NET AJAX Forum
6 answers
209 views
hi,
the parent is a sharepoint page, which has a webpart user control, which contains an iframe, which contains a user control that holds a radgrid control.
the radgrid has sorting filtering and paging enabled, i am using simple databinding and everything seems to work fine except the paging. lets say i have |<   <  1 2 3 4 5 >  >|   when i click on 2, the page posts back and the 2nd page is shown correctly and the number 2 is higlighted and same is the case with 3 and 4, however when i click on 1 (when the current page is 2) , both 1 and 2 are highlighted, the page does a postback but the contents are still of page 2, the next and previous arrows also exhibit the same behaviour. i am using the Black Skin and 2009.1.402.20 version., no matter what i try to do i cannot go back to page 1. this is the same behaviour in IE and FF

i have been reading couple of other threads which recommend using advanced databinding using needdatasource, i have tried that, but strangely the needdatasource method is not getting invoked automatically, the grid is blank.
when using the simple databinding i called the ShowListings() method from page_init(), but i commented those lines, because of the needdatasource method.

please advise.

here is my source code

 

<telerik:RadGrid ID="gvListing" runat="server" Skin="C21Skin" EnableEmbeddedSkins="False" AllowSorting="True" SortingSettings-SortedBackColor="#303030" EnableViewState="true"

 

 

AllowPaging="True" GridLines="None" AutoGenerateColumns="False" AllowFilteringByColumn="true" OnInit="gvListing_Init" OnNeedDataSource="gvListing_NeedDataSource"

 

 

Width="450px" Height="765px" PageSize="10" ShowStatusBar="True" FilterItemStyle-HorizontalAlign="Left" OnItemDataBound="gvListing_ItemDataBound" >

 

 

<PagerStyle Mode="NextPrevAndNumeric" Wrap="False" AlwaysVisible="true" Position="TopAndBottom"></PagerStyle>

 

 

<MasterTableView TableLayout="Fixed">

 

 

<Columns>

 

 

<telerik:GridTemplateColumn UniqueName="Select" Display="true" HeaderText="" ItemStyle-Width="8px"

 

 

ItemStyle-HorizontalAlign="Center" HeaderStyle-Width="8px" HeaderStyle-HorizontalAlign="Center" ItemStyle-Wrap="true"

 

 

AllowFiltering="FALSE">

 

 

<ItemTemplate>

 

 

<asp:CheckBox runat="server" ID="chkSelectListing" OnCheckedChanged="chkSelectListing_OnCheckedChanged" AutoPostBack="true" />

 

 

<asp:Label ID="lblTrKey" Visible="false" runat="server" Text='<%# DataBinder.Eval(Container.DataItem,"Tr_key") %>'></asp:Label>

 

 

</ItemTemplate>

 

 

</telerik:GridTemplateColumn>

 

 

<telerik:GridTemplateColumn HeaderText="Image" UniqueName="Image" AllowFiltering="false" ItemStyle-Width="60px" ItemStyle-HorizontalAlign="Center" HeaderStyle-Width="60px" HeaderStyle-HorizontalAlign="Center" ItemStyle-Wrap="true">

 

 

<ItemTemplate>

 

 

<div style="float:left;background-image:url('http://webservices.21online.com/public/imageresize.aspx?w=60&h=45&url=<%# DataBinder.Eval(Container.DataItem,"jpg_url") %>');background-repeat:no-repeat;width:60px;height:45px;z-index:1;vertical-align:bottom;text-align:right;">

 

 

<br/>

 

 

<div style="background-image:url('<%#Convert.ToInt32(DataBinder.Eval(Container.DataItem, "TotalPhotos").ToString()) > 5 ? "/21online/images/icons/yellow.gif" : "/21online/images/icons/red.gif"%>');background-repeat:no-repeat;z-index:2;width:26px;height:29px;vertical-align:middle;text-align:center;">

 

 

<span style="font-size:10pt;font-weight:bold;color:white;line-height:25px;vertical-align:baseline;"><%# DataBinder.Eval(Container.DataItem,"TotalPhotos") %></span>

 

 

</div>

 

 

</div>

 

 

</ItemTemplate>

 

 

</telerik:GridTemplateColumn>

 

 

<telerik:GridBoundColumn DataField="MLS_ID" Display="true" ItemStyle-ForeColor="white"

 

 

CurrentFilterFunction="StartsWith" AutoPostBackOnFilter="true" SortExpression="MLS_ID"

 

 

UniqueName="MLS_ID" HeaderText="MLS_ID" FilterControlWidth="40px" ItemStyle-Width="70px"

 

 

ItemStyle-HorizontalAlign="Left" HeaderStyle-Width="70px" HeaderStyle-HorizontalAlign="Left" ItemStyle-Wrap="true">

 

 

</telerik:GridBoundColumn>

 

 

<telerik:GridTemplateColumn Display="true" ItemStyle-ForeColor="white"

 

 

SortExpression="Address" UniqueName="Address" HeaderText="Address" ItemStyle-Width="113px" AllowFiltering="FALSE"

 

 

ItemStyle-HorizontalAlign="Left" HeaderStyle-Width="113px" HeaderStyle-HorizontalAlign="Left" ItemStyle-Wrap="true">

 

 

<ItemTemplate>

 

 

<asp:Label ID="lblAddress" CssClass="white11" Visible="true" runat="server" Text='<%# DataBinder.Eval(Container.DataItem,"Address") %>'></asp:Label>,

 

 

<asp:Label ID="lblCity" CssClass="white11" Visible="true" runat="server" Text='<%# DataBinder.Eval(Container.DataItem,"city") %>'></asp:Label>,

 

 

<asp:Label ID="lblState" CssClass="white11" Visible="true" runat="server" Text='<%# DataBinder.Eval(Container.DataItem,"state") %>'></asp:Label>,

 

 

<asp:Label ID="lblZip" CssClass="white11" Visible="true" runat="server" Text='<%# DataBinder.Eval(Container.DataItem,"zip") %>'></asp:Label>

 

 

<asp:Label ID="lblImageURL" CssClass="white11" Visible="false" runat="server" Text='<%# DataBinder.Eval(Container.DataItem,"jpg_url") %>'></asp:Label>

 

 

</ItemTemplate>

 

 

</telerik:GridTemplateColumn>

 

 

<telerik:GridBoundColumn DataField="ListingType" Display="true" ItemStyle-ForeColor="white"

 

 

CurrentFilterFunction="StartsWith" AutoPostBackOnFilter="true" SortExpression="ListingType"

 

 

UniqueName="ListingType" HeaderText="Type" FilterControlWidth="10px" ItemStyle-Width="40px"

 

 

ItemStyle-HorizontalAlign="Left" HeaderStyle-Width="40px" HeaderStyle-HorizontalAlign="Left" ItemStyle-Wrap="false">

 

 

</telerik:GridBoundColumn>

 

 

<telerik:GridBoundColumn DataField="Price" Display="true" ItemStyle-ForeColor="white"

 

 

CurrentFilterFunction="GreaterThan" AutoPostBackOnFilter="true" SortExpression="Price"

 

 

UniqueName="Price" HeaderText="Price" FilterControlWidth="45px" ItemStyle-Width="75px" DataFormatString="{0:c0}"

 

 

ItemStyle-HorizontalAlign="Left" HeaderStyle-Width="75px" HeaderStyle-HorizontalAlign="Left" ItemStyle-Wrap="true">

 

 

</telerik:GridBoundColumn>

 

 

</Columns>

 

 

</MasterTableView>

 

 

<ClientSettings EnableRowHoverStyle="true">

 

 

<Scrolling SaveScrollPosition="true" UseStaticHeaders="true" AllowScroll="true" />

 

 

</ClientSettings>

 

 

</telerik:RadGrid>

and here is the code behind

 

 

protected void gvListing_Init(object sender, System.EventArgs e)

 

{

 

GridFilterMenu menu = gvListing.FilterMenu;

 

 

int i = 0;

 

 

while (i < menu.Items.Count)

 

{

 

if (menu.Items[i].Text == "NoFilter" ||

 

menu.Items[i].Text ==

"Contains" ||

 

menu.Items[i].Text ==

"DoesNotContain" ||

 

menu.Items[i].Text ==

"StartsWith" ||

 

menu.Items[i].Text ==

"EndsWith" ||

 

menu.Items[i].Text ==

"EqualTo" ||

 

menu.Items[i].Text ==

"NotEqualTo" ||

 

menu.Items[i].Text ==

"GreaterThan" ||

 

menu.Items[i].Text ==

"LessThan"

 

 

 

 

)

{

 

switch (menu.Items[i].Text)

 

{

 

case "NoFilter":

 

{

menu.Items[i].Text =

"No Filter";

 

 

break;

 

}

 

case "Contains":

 

{

menu.Items[i].Text =

"Contains";

 

 

break;

 

}

 

case "DoesNotContain":

 

{

menu.Items[i].Text =

"Does Not Contain";

 

 

break;

 

}

 

case "StartsWith":

 

{

menu.Items[i].Text =

"Starts With";

 

 

break;

 

}

 

case "EndsWith":

 

{

menu.Items[i].Text =

"Ends With";

 

 

break;

 

}

 

case "EqualTo":

 

{

menu.Items[i].Text =

"Equal To";

 

 

break;

 

}

 

case "NotEqualTo":

 

{

menu.Items[i].Text =

"Not Equal To";

 

 

break;

 

}

 

case "GreaterThan":

 

{

menu.Items[i].Text =

"Greater Than";

 

 

break;

 

}

 

case "LessThan":

 

{

menu.Items[i].Text =

"Less Than";

 

 

break;

 

}

}

i++;

}

 

else

 

 

 

 

{

menu.Items.RemoveAt(i);

}

}

}

 

protected void gvListing_NeedDataSource(object source, Telerik.Web.UI.GridNeedDataSourceEventArgs e)

 

{

 

 

if (ListingsDS.Tables[0].Rows.Count > 0)

 

{

gvListing.DataSource = ListingsDS.Tables[0];

 

if (CrestNote.Visible == false)

 

{

gvListing.MasterTableView.Columns[4].HeaderText =

"";

 

}

}

 

else

 

 

 

 

{

lblNoOfListings.Text =

"The category you have selected does not require listings.";

 

}

}

 

private void ShowListings()

 

{

 

if (ListingsDS.Tables[0].Rows.Count > 0)

 

{

gvListing.DataSource = ListingsDS.Tables[0];

gvListing.DataBind();

 

if (CrestNote.Visible == false)

 

{

 

//gvListing.Columns[4].Display = false;

 

 

 

 

gvListing.MasterTableView.Columns[4].HeaderText =

"";

 

}

}

 

else

 

 

 

 

{

lblNoOfListings.Text =

"The category you have selected does not require listings.";

 

}

}

 

 

public void chkSelectListing_OnCheckedChanged(object sender, EventArgs e)

 

{

 

CheckBox cb = (CheckBox)sender;

 

 

GridDataItem item = (GridDataItem)cb.NamingContainer;

 

 

Label lblTKey = (Label)item["Select"].FindControl("lblTrKey");

 

 

Label lblAddress = (Label)item["Address"].FindControl("lblAddress");

 

 

Label lblCity = (Label)item["Address"].FindControl("lblCity");

 

 

Label lblState = (Label)item["Address"].FindControl("lblState");

 

 

Label lblZip = (Label)item["Address"].FindControl("lblZip");

 

 

Label lblImageURL = (Label)item["Address"].FindControl("lblImageURL");

 

 

string strTrKey = lblTKey.Text;

 

 

string strTrKeyAddress = lblAddress.Text + ", " + lblCity.Text + ", " + lblState.Text + " " + lblZip.Text;

 

 

string strTrKeyImg = lblImageURL.Text;

 

 

eCampaign_Cart nlList_cart;

 

nlList_cart = CartSession;

 

if (cb.Checked == true)

 

{

nlList_cart.AddOrModifyMember(

new eCampaign_CartItem(strTrKey, strTrKeyAddress, strTrKeyImg));

 

}

 

else

 

 

 

 

{

nlList_cart.DeleteMember(strTrKey);

}

CartSession = nlList_cart;

divCartItemCount.InnerHtml = nlList_cart.getPrintNumberOfItems();

 

}

 

protected void gvListing_ItemDataBound(object sender, Telerik.Web.UI.GridItemEventArgs e)

 

{

 

if (e.Item is GridDataItem)

 

{

 

GridDataItem item = e.Item as GridDataItem;

 

 

string strTrKey = ((Label)item["Select"].FindControl("lblTrKey")).Text;

 

 

bool bSelected = false;

 

 

if (CartSession != null)

 

{

bSelected = CartSession.FindTrKeySelected(strTrKey);

 

if (bSelected)

 

{

 

CheckBox cb = (CheckBox)item["Select"].FindControl("chkSelectListing");

 

cb.Checked =

true;

 

}

}

}

}

Celestyn
Top achievements
Rank 1
 answered on 25 Oct 2012
2 answers
158 views
Hi ,

Using Telerik Ajax Q2 2009 

Using a rad window manager,  if I open a rad window and minimize it and then open another Rad window,  and then  I maximize the first Rad window the maximized window will be in the back and the second Rad window will be on top. 

I believe the issue is related to the z-Index of the maximized window,  is there a way to alter the z-index to set it to a highest number so it will open on top

Sincerely,

Fadi
Fadi
Top achievements
Rank 1
 answered on 25 Oct 2012
2 answers
347 views
Hello,
I have a radbutton with the buttontype of Togglebutton and would like the font size to change when the button is toggled - a larger font when it is selected and a smaller font when it is not.  I am trying to do this through a Css Class.  It seems like everything else works just fine - I can change the font family, font weight, background color, etc., but the font-size does not.  Please help.

Thanks.
Sheldon
Top achievements
Rank 1
 answered on 25 Oct 2012
17 answers
559 views
We are having a problem with our implementation of the RadAjaxPanels and are looking for some assitance and help understanding why we are seeing the behavior we are seeing. We also think there may be a bug involved?

The issue is that we need to have multiple AjaxPanels on a page. We want to load the content in them after the page loads. There may be a lot of content in each, so we want to fire off separate ajax requests for each one and have the data be handled as it returns.

We are making use of the javascript function:

    function pageLoad(sender, args) { 
        if (args._isPartialLoad == false) { 
            $find("RadAjaxPanel1").ajaxRequest(); 
            $find("RadAjaxPanel2").ajaxRequest(); 
        } 
    }  


However, we cannot get this to work properly. We have found that if we put more than 1 ajax request into the function above, we get strange behavior, even if requests are queued. We do not get the exact same behavior every time, but often we get:
1) Only 1 of the requests goes through and as a result only one of the panels gets updated
2) The 2nd request or any subsequent requests are made repeatedly in an infinite loop
3) Every now and then... it works

I have a simple project to reproduce some of these issues, including when using a RadAjaxManager. I also have the HTTP capture of the cases when the 2nd ajaxRequest repeasts in an infinite loop. Please let me how I can upload it. 

Thank you

-- Project notes
-Simple.aspx works fine
-Double.aspx has 2 AjaxPanels and does not work correctly. It has the behavior mentioned above approximately 90% of the time
-DoubleWithManager.aspx also has 2 AjaxPanels. While it functions correctly (since it does not contain 1 ajax calls in the pageLoad function), it is not the functionality we desire, as we want each panel to load asynchronously, not all of them at once, as this does.

In all cases, ajaxrequests done well after the page has fully loaded (such as by clicking one of the buttons) are handled fine. It is only these pageLoad requests that are causing problems.
Greg
Top achievements
Rank 1
 answered on 25 Oct 2012
2 answers
68 views
How can I close a radwindow from within a multipage pageview contenturl content page.
I have a radwindow that is used like a wizard to add a record and to subscribe to the new record.  I have the entire thing working but the second tab to subscribe does not cause the window to close.  Please help, this is urgent. thanks you.

below is the code I use when the subscribe is not within the tabstrip/multipage/pageview and it works great, please tell me what i need to add to close from within the tabstrip/multipage/pageview


function GetRadWindow() {
          var oWindow = null; if (window.radWindow)
              oWindow = window.radWindow; else if (window.frameElement.radWindow)
              oWindow = window.frameElement.radWindow; return oWindow;
      }
      
      function CloseModal() {
          // GetRadWindow().close();
          setTimeout(function () {
              GetRadWindow().BrowserWindow.refreshGrid()
              GetRadWindow().close();
 
          }, 0);
      }
regina
Top achievements
Rank 1
 answered on 25 Oct 2012
3 answers
130 views
How do I set data and/or perform custom operations when using the "AllowAutomaticUpdates" (Inserts/Deletes) property?

I note the "ItemInserted" and "ItemUpdated" events occur, but what about "ItemInserting" or "ItemUpdating" etc?
Eyup
Telerik team
 answered on 25 Oct 2012
2 answers
105 views
Hi all member
I have a RadWindow which set url window to another page.I show window with javascript .I want show window without postback server .
I show window with  javascript but it post to server .
please help to me for solution.
thanks
Marin Bratanov
Telerik team
 answered on 25 Oct 2012
3 answers
501 views
heey guys i got a strange error 

Telerik.Web.UI.GridInsertionObject' does not contain a property with the name 'FromDate'


<%@ Page Title="" Language="C#" MasterPageFile="~/ABBMaster.Master" AutoEventWireup="true"
    CodeBehind="UserEditPanel.aspx.cs" Inherits="HolidayTracker.Administrator.UserEditPanel" %>
 
<%@ Register Assembly="Telerik.Web.UI" Namespace="Telerik.Web.UI" TagPrefix="telerik" %>
<asp:Content ID="Content1" ContentPlaceHolderID="MainRegionContentPlaceHolder" runat="server">
    <telerik:RadScriptManager ID="rsmTelerik" runat="server">
        <Scripts>
            <asp:ScriptReference Assembly="Telerik.Web.UI" Name="Telerik.Web.UI.Common.Core.js"></asp:ScriptReference>
            <asp:ScriptReference Assembly="Telerik.Web.UI" Name="Telerik.Web.UI.Common.jQuery.js"></asp:ScriptReference>
            <asp:ScriptReference Assembly="Telerik.Web.UI" Name="Telerik.Web.UI.Common.jQueryInclude.js"></asp:ScriptReference>
        </Scripts>
    </telerik:RadScriptManager>
 
 
    <br />
 
<%--    <script type="text/javascript">
        function onRequestStart(sender, args) {
            if (args.get_eventTarget().indexOf("ExportToExcelButton") >= 0 ||
                    args.get_eventTarget().indexOf("ExportToWordButton") >= 0 ||
                    args.get_eventTarget().indexOf("ExportToCsvButton") >= 0) {
                args.set_enableAjax(false);
            }
        }
    </script>--%>
    <asp:Panel ID="pnlContent" CssClass="pnlContent" runat="server">
 
        <asp:Panel ID="pnlHeader" CssClass="pnlHeader" runat="server">
        </asp:Panel>
        <asp:Panel ID="pnlBody" CssClass="pnlBody" runat="server">
            <telerik:RadAjaxPanel ID="RadAjaxPanel1" runat="server" Skin="Default" LoadingPanelID="RadAjaxLoadingPanel1">
                <fieldset style="padding: 10px; margin-bottom: 10px;">
                    <legend>User form</legend>
                    <div class="formRowDiv">
                        <asp:Label ID="label4" CssClass="formLabel" runat="server" Text="Email"></asp:Label>
                        <telerik:RadComboBox ID="rcbSearch" CssClass="rowForm" runat="server" Width="260px"
                            Height="100px" EmptyMessage="Enter Email" EnableLoadOnDemand="true" AutoPostBack="true"
                            OnItemsRequested="rcbSearch_ItemsRequested" CausesValidation="false" OnSelectedIndexChanged="rcbSearch_IndexChanged">
                        </telerik:RadComboBox>
                        <asp:RegularExpressionValidator ID="revEmail" runat="server" Display="Dynamic" ControlToValidate="rcbSearch"
                            ValidationExpression="^[\w\.\-]+@[a-zA-Z0-9\-]+(\.[a-zA-Z0-9\-]{1,})*(\.[a-zA-Z]{2,3}){1,2}$"
                            ErrorMessage="Enter a valid email address" />
                        <asp:RequiredFieldValidator ID="rfvEmail" runat="server" Display="Dynamic" ControlToValidate="rcbSearch"
                            ErrorMessage="Can not be empty" CssClass="rowFormValidation" />
                    </div>
                    <div class="formRowDiv">
                        <asp:Label ID="label1" CssClass="formLabel" runat="server" Text="Firstname"></asp:Label>
                        <telerik:RadTextBox ID="rtbFirstName" CssClass="rowForm" runat="server" ReadOnly="True" />
                        <asp:RequiredFieldValidator ID="rfvFirstName" runat="server" Display="Dynamic" ControlToValidate="rtbFirstName"
                            ErrorMessage="Can not be empty" CssClass="rowFormValidation" />
                    </div>
                    <div class="formRowDiv">
                        <asp:Label ID="label2" CssClass="formLabel" runat="server" Text="Lastname"></asp:Label>
                        <telerik:RadTextBox ID="rtbLastName" CssClass="rowForm" runat="server" ReadOnly="True" />
                        <asp:RequiredFieldValidator ID="rfvLastName" runat="server" Display="Dynamic" ControlToValidate="rtbLastName"
                            ErrorMessage="Can not be empty" CssClass="rowFormValidation" />
                    </div>
                    <div class="formRowDiv">
                        <asp:Label ID="label3" CssClass="formLabel" runat="server" Text="Username"></asp:Label>
                        <telerik:RadTextBox ID="rtbUserName" CssClass="rowForm" runat="server" ReadOnly="True" />
                        <asp:RequiredFieldValidator ID="rfvUserName" runat="server" Display="Dynamic" ControlToValidate="rtbUserName"
                            ErrorMessage="Can not be empty" CssClass="rowFormValidation" />
                    </div>
                    <div class="formRowDiv" style="display: none;">
                        <asp:Label ID="label5" CssClass="formLabel" runat="server" Text="AdAccount"></asp:Label>
                        <telerik:RadTextBox ID="rtbAdAccount" CssClass="rowForm" runat="server" ReadOnly="True" />
                    </div>
                    <div class="formRowDiv" style="display: none;">
                        <asp:Label ID="label6" CssClass="formLabel" runat="server" Text="AdDomain"></asp:Label>
                        <telerik:RadTextBox ID="rtbAdDomain" CssClass="rowForm" runat="server" ReadOnly="True" />
                    </div>
                    <div class="formRowDiv">
                        <asp:Label ID="label8" runat="server" Text="Role" CssClass="formLabel"></asp:Label>
                        <telerik:RadComboBox ID="rcbUserRoles" CssClass="rowForm" CheckBoxes="True" EmptyMessage="- Please select -"
                            runat="server" DataTextField="Name" DataValueField="RoleId">
                        </telerik:RadComboBox>
                        <asp:SqlDataSource ID="UserRoleSqlSource" runat="server" ConnectionString="<%$ ConnectionStrings:ConnectionString %>"
                            SelectCommand="SELECT * FROM [HtUserRole]"></asp:SqlDataSource>
                    </div>
                    <div class="formRowDiv">
                        <%--  <asp:Label ID="label7" CssClass="formLabel" runat="server" Text="Annual vacations"></asp:Label> --%>
                        <telerik:RadAjaxPanel ID="RadAjaxPanel2" runat="server" LoadingPanelID="RadAjaxLoadingPanel1">
 
                            <telerik:RadGrid ID="rgAnnualVacation" runat="server" CellSpacing="0" GridLines="None" AllowPaging="True" AutoGenerateDeleteColumn="True"
                                OnInsertCommand="rgAnnualVacation_InsertCommand" OnDeleteCommand="rgAnnualVacation_DeleteCommand" Height="200px"
                                OnUpdateCommand="rgAnnualVacation_UpdateCommand" OnNeedDataSource="rgAnnualVacation_NeedDataSource">
 
                                <MasterTableView AutoGenerateColumns="false" DataKeyNames="AnnualVacationId" CommandItemDisplay="Top" InsertItemPageIndexAction="ShowItemOnCurrentPage">
 
                                    <Columns>
                                        <telerik:GridBoundColumn DataField="AnnualVacationId" Visible="false" DataType="System.Int32" FilterControlAltText="Filter AnnualVacationId column" HeaderText="AnnualVacationId" ReadOnly="True" SortExpression="AnnualVacationId" UniqueName="AnnualVacationId">
                                        </telerik:GridBoundColumn>
                                        <telerik:GridBoundColumn DataField="UserId" Visible="false" DataType="System.Int32" FilterControlAltText="Filter UserId column" HeaderText="UserId" SortExpression="UserId" UniqueName="UserId">
                                        </telerik:GridBoundColumn>
                                        <telerik:GridBoundColumn DataField="FromDate" DataType="System.DateTime" FilterControlAltText="Filter FromDate column" HeaderText="FromDate" SortExpression="FromDate" UniqueName="FromDate">
                                        </telerik:GridBoundColumn>
                                        <telerik:GridBoundColumn DataField="ToDate" DataType="System.DateTime" FilterControlAltText="Filter ToDate column" HeaderText="ToDate" SortExpression="ToDate" UniqueName="ToDate">
                                        </telerik:GridBoundColumn>
                                        <telerik:GridBoundColumn DataField="WorkingTime" DataType="System.Int32" FilterControlAltText="Filter WorkingTime column" HeaderText="WorkingTime" SortExpression="WorkingTime" UniqueName="WorkingTime">
                                        </telerik:GridBoundColumn>
                                        <telerik:GridBoundColumn DataField="VacationDays" DataType="System.Double" FilterControlAltText="Filter VacationDays column" HeaderText="VacationDays" SortExpression="VacationDays" UniqueName="VacationDays">
                                        </telerik:GridBoundColumn>
                                        <telerik:GridEditCommandColumn />
                                    </Columns>
 
                                    <EditFormSettings EditFormType="Template">
                                        <FormTemplate>
                                            <table>
                                                <tr>
                                                    <td>From</td>
                                                    <td>
                                                        <telerik:raddatepicker id="fromdatepicker" runat="server" dbselecteddate='<%# bind("fromdate") %>'
                                                            tabindex="4">
                                                        </telerik:raddatepicker>
                                                    </td>
                                                </tr>
                                                <tr>
                                                    <td>To</td>
                                                    <td>
                                                        <telerik:raddatepicker id="todatepicker" runat="server" mindate="1/1/1900" dbselecteddate='<%# bind("todate") %>'
                                                            tabindex="4">
                                                        </telerik:raddatepicker>
                                                    </td>
                                                </tr>
                                                <tr>
                                                    <td>Working time (%)</td>
                                                    <td>
                                                        <telerik:RadNumericTextBox ID="txtWorkingTime" runat="server" NumberFormat-DecimalDigits="0" DbValue='<%# Bind("WorkingTime") %>'></telerik:RadNumericTextBox>
                                                    </td>
                                                </tr>
                                                <tr>
                                                    <td>Vacation days</td>
                                                    <td>
                                                        <telerik:RadNumericTextBox ID="txtVacationDays" runat="server" NumberFormat-DecimalDigits="2" DbValue='<%# Bind("VacationDays") %>'></telerik:RadNumericTextBox>
                                                    </td>
                                                </tr>
 
                                            </table>
 
                                            <table style="margin-top: 15px;">
                                                <tr>
                                                    <td>
                                                        <asp:Button ID="btnUpdate" Text='<%# (Container is GridEditFormInsertItem) ? "Insert" : "Update" %>'
                                                            runat="server" CommandName='<%# (Container is GridEditFormInsertItem) ? "PerformInsert" : "Update" %>'></asp:Button
                                                    </td>
                                                    <td>
                                                        <asp:Button ID="btnCancel" Text="Cancel" runat="server" CausesValidation="False"
                                                            CommandName="Cancel"></asp:Button>
                                                    </td>
                                                </tr>
                                            </table>
                                        </FormTemplate>
                                    </EditFormSettings>
                                    <%--<CommandItemSettings ShowExportToWordButton="true" ShowExportToExcelButton="true" ShowExportToCsvButton="true" />--%>
                                </MasterTableView>
                                <FilterMenu EnableImageSprites="False">
                                </FilterMenu>
 
                            </telerik:RadGrid>
                        </telerik:RadAjaxPanel>
                    </div>
                    <div class="formRowDiv">
                        <telerik:RadButton ID="rbBack" CssClass="rowButton" runat="server" Text="Back" OnClick="rbBack_Clicked"
                            CausesValidation="false" />
                        <telerik:RadButton ID="rbSave" CssClass="rowButton" runat="server" Text="Save" OnClick="rbSave_Clicked" />
                    </div>
                </fieldset>
            </telerik:RadAjaxPanel>
            <telerik:RadAjaxLoadingPanel ID="RadAjaxLoadingPanel1" runat="server" Skin="Default">
            </telerik:RadAjaxLoadingPanel>
        </asp:Panel>
        <asp:Panel ID="pnlFooter" CssClass="pnlFooter" runat="server">
        </asp:Panel>
    </asp:Panel>
</asp:Content>



using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using HolidayTracker.Data.Model;
using Telerik.Web.UI;
using HolidayTracker.Code;
using System.Collections;
 
namespace HolidayTracker.Administrator {
    public partial class UserEditPanel : System.Web.UI.Page {
 
        private List<AnnualVacation> annualVacations = new List<AnnualVacation>();
 
        private Boolean newUser;
        private HtUser paramUser;
        private HtUser user;
        private HtUser User {
            get {
                user = HtUser.INIT_USER(this.Page, true);
                return user;
            }
        }
 
        protected void Page_Load(object sender, EventArgs e) {
            getParameters();
            if (!IsPostBack) {
 
                bindData();
 
                fillFieldsWithData();
                initFieldSettings();
            }
        }
 
        private void getParameters() {
            if (Page.Request["userId"] != null) {
                int userId = Constants.TryConvert(Page.Request["userId"], this.Page);
                this.paramUser = HtUser.GetById(userId);
            } else {
                this.paramUser = new HtUser();
            }
        }
 
        private void initFieldSettings() {
            if (!newUser) {
                this.rcbSearch.Enabled = false;
            }
        }
 
        private void bindData() {
            this.rcbUserRoles.DataSource = this.UserRoleSqlSource;
            this.rcbUserRoles.DataBind();
 
            //fill viewstate with annual vacations if empty
            if (paramUser != null && paramUser.AnnualVacations.Any())
            {
                if (ViewState["AnnualVacationSource"] == null)
                {
                    annualVacations.AddRange(paramUser.AnnualVacations);
                    ViewState["AnnualVacationSource"] = annualVacations;
                }
            }
        }
 
        private void fillFieldsWithData() {
            if (paramUser != null) {
                this.rtbFirstName.Text = paramUser.FirstName;
                this.rtbLastName.Text = paramUser.LastName;
                this.rtbUserName.Text = paramUser.UserName;
                this.rcbSearch.Text = paramUser.Email;
                this.rtbAdAccount.Text = paramUser.AdAccount;
                this.rtbAdDomain.Text = paramUser.AdDomain;
 
                //UserRole
                IEnumerable<HtUserRole> userRoles = paramUser.HtUserRoles != null ? paramUser.HtUserRoles : null;
                if (userRoles != null && userRoles.Count() > 0) {
                    foreach (RadComboBoxItem rcbi in rcbUserRoles.Items) {
                        rcbi.Checked = false;
                        foreach (HtUserRole ur in userRoles) {
                            if (ur.RoleId.ToString() == rcbi.Value) {
                                rcbi.Checked = true;
                                break;
                            }
                        }
                    }
                }
            }
        }
 
        protected void rcbSearch_ItemsRequested(object sender, RadComboBoxItemsRequestedEventArgs e) {
            if (e.Text != null && e.Text.Length > 2) {
                IEnumerable<HtUser> result = null;
                AdLookup lookup = new AdLookup();
                result = lookup.SearchAdUserByEmail(e.Text);//HtUser.SearchByEmail(e.Text);
                if (result != null && result.Count() > 0) {
                    foreach (HtUser user in result) {
                        this.rcbSearch.Items.Add(new RadComboBoxItem(user.Email, user.UserId.ToString()));
                    }
                }
            }
        }
 
        protected void rcbSearch_IndexChanged(object sneder, RadComboBoxSelectedIndexChangedEventArgs e) {
            string email = e.Text;
            AdLookup lookup = new AdLookup();
            paramUser = lookup.GetAdUserByEmail(email);
            fillFieldsWithData();
        }
 
        private void saveData() {
            HolidayTrackerEntities ctx = HtEntityFactory.Context;
            HtUser userToSave = ctx.HtUsers.Where(u => u.UserId == paramUser.UserId).FirstOrDefault();
            if (userToSave == null) {
                userToSave = new HtUser();
                userToSave.IsNew = true;
            }
            userToSave.FirstName = this.rtbFirstName.Text;
            userToSave.LastName = this.rtbLastName.Text;
            userToSave.UserName = this.rtbUserName.Text;
            userToSave.Email = this.rcbSearch.Text;
            userToSave.AdAccount = this.rtbAdAccount.Text;
            userToSave.AdDomain = this.rtbAdDomain.Text;
 
            //UserRole
            foreach (RadComboBoxItem rcbi in rcbUserRoles.Items) {
                HtUserRole newUserRole = HtUserRole.GetById(int.Parse(rcbi.Value));
 
                if (rcbi.Checked) {
                    if (userToSave.HtUserRoles.Where(x => x.RoleId == newUserRole.RoleId).Count() == 0) {
                        userToSave.HtUserRoles.Add(newUserRole);
                    }
                } else {
                    if (userToSave.HtUserRoles.Where(x => x.RoleId == newUserRole.RoleId).Count() > 0) {
                        userToSave.HtUserRoles.Remove(newUserRole);
                    }
                }
            }
 
            if (userToSave.IsNew) {
                ctx.AddToHtUsers(userToSave);
            }
 
            if (((List<AnnualVacation>)ViewState["AnnualVacationSource"]) != null) {
                List<AnnualVacation> vacationToSave = (List<AnnualVacation>)ViewState["AnnualVacationSource"];
                IEnumerable<AnnualVacation> existing = paramUser.AnnualVacations;
                foreach (AnnualVacation toSave in vacationToSave) {
                    //if (toSave.IsNew) {
                    //    ctx.AddToAnnualVacations(toSave);
                    //}
                        
                    //Zu löschende aus context löschen
                }
            }
 
            ctx.SaveChanges();
        }
 
        protected void rbBack_Clicked(object sender, EventArgs e) {
            Response.Redirect("~/Administrator/UserPanel.aspx");
        }
 
        protected void rbSave_Clicked(object sender, EventArgs e) {
            saveData();
            fillFieldsWithData();
        }
 
        protected void rgAnnualVacation_InsertCommand(object sender, GridCommandEventArgs e) {
            try {
                GridEditableItem item = e.Item as GridEditableItem;
                Hashtable values = new Hashtable();
                item.ExtractValues(values);
 
                AnnualVacation newAnnualVacation = new AnnualVacation();
                item.UpdateValues(newAnnualVacation);
                //newAnnualVacation.IsNew = true;
 
                ((List<AnnualVacation>)ViewState["AnnualVacationSource"]).Add(newAnnualVacation);
            } catch {
                //Hier fehlermeldung
            }
 
        }
 
        protected void rgAnnualVacation_DeleteCommand(object sender, GridCommandEventArgs e) {
            int annualVacationId = int.Parse((e.Item as GridDataItem).GetDataKeyValue("AnnualVacationId").ToString());
            ((List<AnnualVacation>)ViewState["AnnualVacationSource"]).
                Remove(((List<AnnualVacation>)ViewState["AnnualVacationSource"]).
                Where(av => av.AnnualVacationId == annualVacationId).FirstOrDefault());
        }
 
        protected void rgAnnualVacation_NeedDataSource(object sender, GridNeedDataSourceEventArgs e) {
            rgAnnualVacation.DataSource = ViewState["AnnualVacationSource"];
            if (rgAnnualVacation.DataSource == null)
            {
                rgAnnualVacation.DataSource = String.Empty;
            }
        }
 
        protected void rgAnnualVacation_UpdateCommand(object sender, GridCommandEventArgs e) {
 
        }
       
         }
}


plzz  dont give me just a reference plzz help thanks allot !!!!!  

Thanks for fast answer ! 
Pavlina
Telerik team
 answered on 25 Oct 2012
3 answers
93 views
I am using Tabstrip control in my aspx page with multipage view as given below.I am moving to next tab on click of a button.But while giving the RadTabStrip1 & RadMultiPage1 in the AjaxUpdatedControl,I am getting the blow error: "Microsoft JScript runtime error: Unable to set value of the property 'control': object is null or undefined"

MY CODE GOES AS BELOW:
-------------------------------------------

<telerik:RadAjaxManager ID="RadAjaxManager1" runat="server" OnAjaxRequest="RadAjaxManager1_AjaxRequest" >
        <AjaxSettings>
            <telerik:AjaxSetting AjaxControlID="RadAjaxManager1">
                <UpdatedControls>
<telerik:AjaxUpdatedControl ControlID="RadMultiPagetab" /> -- (if i mentioned this one i am getting error)
<telerik:AjaxUpdatedControl ControlID="RadTabStrip2" />
 </UpdatedControls>
            </telerik:AjaxSetting>
</AjaxSettings>
    </telerik:RadAjaxManager>

 <div style="float: left; width: 100%; min-height: 830px;">
        <div style="float: left; width: 100%; background-image: url(../images/bridge_logo_bg.jpg);
            background-repeat: repeat-x;">
 <telerik:RadTabStrip ID="RadTabStrip2" runat="server" MultiPageID="RadMultiPagetab"
                SelectedIndex="0" Orientation="HorizontalTop" ShowBaseLine="true" CssClass="tabStrip">
                <Tabs>
                    <telerik:RadTab Text="Overview" ToolTip="Overview">
                    </telerik:RadTab>
                    <telerik:RadTab Text="Attendance" ToolTip="Attendance">
                    </telerik:RadTab>
                    <telerik:RadTab Text="Discipline" ToolTip="Discipline">
                    </telerik:RadTab>                   
                </Tabs>
            </telerik:RadTabStrip>
</div>
<telerik:RadMultiPage ID="RadMultiPagetab" runat="server" SelectedIndex="0" >
            <!-- Overview -->
            <telerik:RadPageView ID="RadPageView2" runat="server">
<telerik:RadHtmlChart runat="server" ID="radhtml_dt" Width="240px" Height="300px"
                                        OnClientSeriesClicked="OnClientSeriesClicked">
                                        <Appearance>
                                            <FillStyle />
                                        </Appearance>
                                        <Legend>
                                            <Appearance Visible="false" />
                                        </Legend>
                                        <PlotArea>
                                            <YAxis>
                                            </YAxis>
                                        </PlotArea>
                                        <Legend>
                                            <Appearance Position="Right" />
                                        </Legend>
                                        <ChartTitle Text="Disc : Top 10">
                                        </ChartTitle>
                                    </telerik:RadHtmlChart>
                                </div>
 </telerik:RadPageView>
            <telerik:RadPageView ID="Disc" runat="server">
..... some controls---------------
 </telerik:RadPageView>
 <telerik:RadPageView ID="Enroll" runat="server">
----some controls---------------
 </telerik:RadPageView>
 </telerik:RadMultiPage>

 <telerik:RadCodeBlock ID="codeBlock" runat="server">
        <script type="text/javascript">
            function OnClientSeriesClicked(sender, args) {
                // debugger;
                $find("<%= RadAjaxManager1.ClientID %>").ajaxRequest(args.get_category() + ";" + sender._uniqueId);
                var totstring = args._seriesData.toString();
                var count = (totstring.split(",").length)
                for (var i = 0; i < count; i++) {
                    if (args._seriesData[i].value != args.get_value()) {
                        args._seriesData[i].explode = false;
                    }
                    else {
                        args._seriesData[i].explode = true;
                    }
                }
                sender.repaint();
            }
           
        </script>
 </telerik:RadCodeBlock>


Nencho
Telerik team
 answered on 25 Oct 2012
8 answers
79 views
Please disregard my thread below. I converted all my <images> to <asp:images> and put them into the controls collection to get what I needed. Lots of work but a better result.

Anyway, I'm attaching a project that won't pick up my customized styles if I set them at runtime. If I set them at design time they get picked up and work just fine.

When I dynamically add 10 images and set them each with one of 4 custom styles it has a clear tooltip with transparent everything except text. 

Thanks in advance!

Marin Bratanov
Telerik team
 answered on 25 Oct 2012
Narrow your results
Selected tags
Tags
+? more
Top users last month
Boardy
Top achievements
Rank 2
Veteran
Iron
Benjamin
Top achievements
Rank 3
Bronze
Iron
Veteran
ivory
Top achievements
Rank 1
Iron
Iron
Rob
Top achievements
Rank 3
Bronze
Bronze
Iron
ClausDC
Top achievements
Rank 2
Iron
Iron
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
Boardy
Top achievements
Rank 2
Veteran
Iron
Benjamin
Top achievements
Rank 3
Bronze
Iron
Veteran
ivory
Top achievements
Rank 1
Iron
Iron
Rob
Top achievements
Rank 3
Bronze
Bronze
Iron
ClausDC
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?