Telerik Forums
UI for ASP.NET AJAX Forum
1 answer
110 views
How to collapse all expanded rows other than the clicked one in hierarchical grid.
Princy
Top achievements
Rank 2
 answered on 03 Jun 2009
1 answer
74 views
Hi,
 i am working on  2009 Q1 Version of radcontrols  for RadComboBox  i have given autopostback as true  but after postback itis not  firing onResponedEnd Event in firefox version 3.0.3, itis working fine in IE7.
Swapnil
Top achievements
Rank 1
 answered on 03 Jun 2009
3 answers
58 views
Here's one you can try at home.

Create a page with a grid and a datasource. Add a toolbar as the commanditem for your grid.

Here's one I prepared earlier ...

<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="WebForm6.aspx.cs" Inherits="WebApplication1.WebForm6" %> 
<%@ Register Assembly="Telerik.Web.UI" Namespace="Telerik.Web.UI" TagPrefix="telerik" %> 
 
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> 
 
<html xmlns="http://www.w3.org/1999/xhtml" > 
<head runat="server"
    <title></title
</head> 
<body> 
    <form id="form1" runat="server"
    <telerik:RadScriptManager ID="RadScriptManager1" runat="server"
    </telerik:RadScriptManager> 
     
    <telerik:RadGrid ID="RadGrid1" runat="server" AutoGenerateColumns="False" DataSourceID="SqlDataSource1" GridLines="None" Skin="WebBlue" Width="100%"
<MasterTableView DataSourceID="SqlDataSource1" CommandItemDisplay="Top" DataKeyNames="ProductID"
    <CommandItemTemplate> 
    <telerik:RadToolBar runat="server" ID="GridCommandItemToolbar" AutoPostBack="false" Skin="Office2007"  Style="width: 100%" Visible="true"
      <CollapseAnimation Duration="200" Type="OutQuint" /> 
      <Items> 
        <telerik:RadToolBarButton runat="server" Enabled="false" ToolTip="Add Document" Value="AddDocument" CommandName="InitInsert" ImageUrl="~/Images/Office/document_file/png/16/document_add_16x16.png"
        </telerik:RadToolBarButton> 
        <telerik:RadToolBarButton runat="server" Enabled="false" ToolTip="Edit Document" Value="EditDocument" ImageUrl="~/Images/Office/document_file/png/16/document_edit_16x16.png"
        </telerik:RadToolBarButton> 
        <telerik:RadToolBarButton runat="server" Enabled="false" ToolTip="Delete Document" Value="DeleteDocument" ImageUrl="~/Images/Office/document_file/png/16/document_delete_16x16.png"
        </telerik:RadToolBarButton> 
      </Items> 
    </telerik:RadToolBar> 
  </CommandItemTemplate> 
<RowIndicatorColumn> 
<HeaderStyle Width="20px"></HeaderStyle> 
</RowIndicatorColumn> 
 
<ExpandCollapseColumn> 
<HeaderStyle Width="20px"></HeaderStyle> 
</ExpandCollapseColumn> 
  <Columns> 
    <telerik:GridBoundColumn DataField="ProductID" DataType="System.Int32" HeaderText="ProductID" ReadOnly="True" SortExpression="ProductID" UniqueName="ProductID"
    </telerik:GridBoundColumn> 
    <telerik:GridBoundColumn DataField="ProductName" HeaderText="ProductName" SortExpression="ProductName" UniqueName="ProductName"
    </telerik:GridBoundColumn> 
  </Columns> 
</MasterTableView> 
      <ClientSettings> 
        <Scrolling AllowScroll="True" UseStaticHeaders="True" /> 
      </ClientSettings> 
    </telerik:RadGrid> 
    <asp:SqlDataSource ID="SqlDataSource1" runat="server" ConnectionString="<%$ ConnectionStrings:NORTHWIND.MDFConnectionString %>" SelectCommand="SELECT [ProductID], [ProductName] FROM [Current Product List]"></asp:SqlDataSource> 
 
    </form> 
</body> 
</html> 
 
Run the page and all should be well.

Now, on Line 15 add HorizontalAlign="Left". Run the project again. You'll find, if you're seeing what we're seeing, that your data and headers are all off to the right of your commanditem. You get equally odd results using "Right" or "Center" as the values for HorizontalAlign.

I discovered this by after first running someone else's code after applying SP2.

--
Stuart
Dimo
Telerik team
 answered on 03 Jun 2009
2 answers
168 views
The 'problem' with using ToolTipManager (TTM) is that you have to apply the same settings to all of the tooltips on the page (or so it seems to me).

I thought to change that using code like this ...
        protected void RadToolTipManager1_AjaxUpdate(object sender, Telerik.Web.UI.ToolTipUpdateEventArgs e) 
        { 
            Label l = new Label(); 
            switch (e.TargetControlID) 
            { 
                case "dpCreateDate"
                case "dpPublicationDate"
                case "dpReviewDate"
                    RadToolTipManager1.Position = Telerik.Web.UI.ToolTipPosition.MiddleRight; 
                    break
 
                default
                    RadToolTipManager1.Position = Telerik.Web.UI.ToolTipPosition.BottomCenter; 
                    break
            } 
        } 
Needless to say, it doesn't appear to work; the default case seems to try and display something but I couldn't say what; the other case just causes the standard tooltips to appear.

Is it possible to do what it is I'm attempting?

--
Stuart

Stuart Hemming
Top achievements
Rank 2
 answered on 03 Jun 2009
1 answer
174 views
Good evening. I am using Radsplitter in the master page. And the content pages have different heights. I want the Radsplitter height to be 100% of the content page height. I tried using 
MasterPage myMaster = (MasterPage)this.Master;

(

RadSplitter)(myMaster.FindControl("RadSplitterBuilding"))).Height = Unit.Percentage(100);
But it does not work. Please let me know a way to deteremine the Page height on client-side before it is rendered to the browser, and set the radsplitter height to the same.
Thanks
Anil

 

Svetlina Anati
Telerik team
 answered on 03 Jun 2009
4 answers
343 views
Hi there,

Currently I'm giving notifications like so:
        public static string ItemUpdated(object source, GridUpdatedEventArgs e, RadGrid RadGrid1) 
        { 
            GridEditableItem item = (GridEditableItem)e.Item; 
            string displayMsg = string.Empty; 
            string name = item.OwnerTableView.Name; 
            foreach(string dataKeyName in RadGrid1.MasterTableView.DataKeyNames) 
            { 
                string id = item.GetDataKeyValue(dataKeyName).ToString(); 
 
                if (e.Exception != null
                { 
                    e.KeepInEditMode = true
                    e.ExceptionHandled = true
                    displayMsg = string.Format("{0} with ID " + id + " cannot be updated. Reason: " + e.Exception.Message, name); 
                } 
                else 
                { 
                    displayMsg = string.Format("{0} with ID " + id + " is updated!", name);                     
                } 
            } 
            return displayMsg; 
        } 

It's probably simple but instead of getting the Id of the record I'm working with I'd like to get one of the column values. Lets say I have a column of Name. Then I'd like to get the name value and produce the message "'Name' was updated" instead of what I have now which gives me the Id.

Thanks :)


Darren
Top achievements
Rank 2
 answered on 03 Jun 2009
1 answer
94 views
I was using an older verion of ASP.NET AJAX that had the type Telerik.WebControls.EditorFileTypes, but now that I've upgraded to the new version, where did this type move to?

Thanks.
Tervel
Telerik team
 answered on 03 Jun 2009
3 answers
469 views
Hello,

I have a RadGrid with GridEditCommandColumn inside ajaxToolkit:ModalPopupExtender panel. RadGrid is populated with asp ObjectDataSource, which has insert/update/delete methods triggered every time I click on a button in RadGrid ('Edit' button of the GridEditCommandColumn, for example). When an Update event is fired, all my controls inside the panel and including the panel itself are null, so I found a workaround and use RadGrid_ItemCommand function instead. This way I can set and validate my contols, and I can get an index in the grid and an event name fired.

My problem is that I have to use Request.Params to find changed Name on Edit, and this is not a good programming practice (even though it works). How can I replace Request.Params or at least set a name for the GridEditCommandColumn?

 

protected void RadGrid1_ItemCommand(object source, GridCommandEventArgs e)
{
...

if (Request.Params["__EVENTTARGET"].Contains("UpdateButton"))

 

 

int index = e.Item.DataSetIndex;

 

int locationID = CurrentClub.Locations[index].LocationId;

ValidateUpdatedItem(locationID, Request.Params.Get(

 

 

"ctl00$ctl00$phBody$phBody$ucEditEventLoc$rgLocations$ctl00$ctl09$ctl00"));

}

 

 

else

 

if (Request.Params["__EVENTTARGET"].Contains("PerformInsertButton"))

ValidateNewItem(Request.Params.Get(

 

 

"ctl00$ctl00$phBody$phBody$ucEditEventLoc$rgLocations$ctl00$ctl02$ctl02$ctl00"));
}

----------------------------------- ascx page

<

 

 

telerik:RadAjaxManagerProxy ID="RadAjaxManagerProxy1" runat="server">

 

<AjaxSettings>

 

 

 

 

<telerik:AjaxSetting AjaxControlID="rgLocations">

 

 

 

 

<UpdatedControls>

 

 

 

 

<telerik:AjaxUpdatedControl ControlID="rgLocations" />

 

 

 

 

<telerik:AjaxUpdatedControl ControlID="lblErrorMessage" />

 

 

 

 

</UpdatedControls>
</telerik:AjaxSetting>
</AjaxSettings>
</telerik:RadAjaxManagerProxy>

 

 

 

 

 

<ajaxToolkit:ModalPopupExtender ID="mdlPopupLocation" runat="server" PopupControlID="pnLocation"

 

 

 

 

BackgroundCssClass="modalBackground" TargetControlID="btnAddLocation">

 

 

 

 

 </ajaxToolkit:ModalPopupExtender>

 

 

 

 

 

<asp:Panel runat="server" ID="pnLocation" CssClass="pnlPop" Style="display: none;EnableViewState="true">

 

 

 

 

<telerik:RadGrid ID="rgLocations" runat="server" GridLines="None" AllowPaging="True" AllowSorting="False" DataSourceID="objDSLocations" AutoGenerateColumns="False" AllowAutomaticDeletes="True"

 

 

 

 

AllowAutomaticInserts="True" AllowAutomaticUpdates="True" HorizontalAlign="NotSet"

 

 

 

 

ShowStatusBar="false" OnItemDataBound="RadGrid1_ItemDataBound" OnItemCommand="RadGrid1_ItemCommand">

 

 

 

 

<MasterTableView DataKeyNames="LocationId" CommandItemDisplay="Bottom" CommandItemSettings-RefreshImageUrl=""

 

 

 

 

CommandItemSettings-RefreshText="" GridLines="None" Width="100%" EditMode="InPlace">

 

 

 

 

<Columns>
<telerik:GridBoundColumn UniqueName="LocationName" EditFormColumnIndex="0" HeaderText="Location Name"  DataField="Name"> </telerik:GridBoundColumn>

 

 

 

 

<telerik:GridEditCommandColumn UniqueName="editcmdColumnLoc">

 

 

 

 

</telerik:GridEditCommandColumn>

 

 

 

 

<telerik:GridButtonColumn Text="Delete" CommandName="Delete"  UniqueName= "DeleteColumn"></telerik:GridButtonColumn>

 

 

 

 

</Columns>

 

 

 

 

<ExpandCollapseColumn ButtonType="ImageButton" Visible="False" UniqueName="ExpandColumn">

 

 

 

 

<HeaderStyle Width="19px"></HeaderStyle>

 

 

 

 

</ExpandCollapseColumn>

 

 

 

</MasterTableView>  

 

<PagerStyle Mode="NextPrevAndNumeric"></PagerStyle>

 

</telerik:RadGrid>

 

 

 

<asp:ObjectDataSource ID="objDSLocations" runat="server" SelectMethod="SelectLocations"

 

 

 

 

InsertMethod="InsertLocations" UpdateMethod="UpdateLocations" TypeName="CHO.Next.WebUI.UserControls.Events.EditEventLocation">

 

 

 

 

<UpdateParameters>

 

 

 

<asp:Parameter Name="LocationId" Type="Int32" />

 

<asp:Parameter Name="Name" Type="String" />

 

 

</UpdateParameters>

 

 

 

<InsertParameters>

 

<asp:Parameter Name="Name" Type="String" />

 

</InsertParameters>

 

 

</asp:ObjectDataSource>

 

 

 

 

 

 

Thank you

 

 

 

 

 

Sebastian
Telerik team
 answered on 03 Jun 2009
3 answers
138 views
I have the following DB view :

ID   Language  DisplayLanguage
1     Arabic       Saudi Arabia (ARA)
2     Arabic        Egypt (ARE)
3     English       English(US)
4     English       English(BR)


I want to represent this view in a treeView with Language as parent node and DisplayLanguage as child nodes.

<

 

telerik:RadTreeView ID="targetTreeView"

 

 

TriStateCheckBoxes="true"

 

 

CheckChildNodes="true"

 

 

Skin="Web20"

 

 

CheckBoxes="true"

 

 

DataSourceID="odsLanguages"

 

 

DataFieldID="ID"

 

 

DataFieldParentID="Language"

 

 

DataTextField="Language"

 

 

runat="server">

 

 

</telerik:RadTreeView>

The combination DataFieldID, DataFieldParentID, DatatextField is not working.

Any help please?

 

Joseph
Top achievements
Rank 1
 answered on 03 Jun 2009
1 answer
107 views
I have a requirement that before navigating to the next tab validate one javascript in OnClientTabSelecting  if the javascript function value returns true then only i want to navigate to next tab if it returns false i want to be in the same tab with out postback or tab change
Shinu
Top achievements
Rank 2
 answered on 03 Jun 2009
Narrow your results
Selected tags
Tags
+? more
Top users last month
Simon
Top achievements
Rank 2
Iron
Iron
Iron
Bob
Top achievements
Rank 3
Iron
Iron
Veteran
Marco
Top achievements
Rank 4
Iron
Iron
Iron
Grant
Top achievements
Rank 3
Iron
Iron
Iron
Kao Hung
Top achievements
Rank 1
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
Simon
Top achievements
Rank 2
Iron
Iron
Iron
Bob
Top achievements
Rank 3
Iron
Iron
Veteran
Marco
Top achievements
Rank 4
Iron
Iron
Iron
Grant
Top achievements
Rank 3
Iron
Iron
Iron
Kao Hung
Top achievements
Rank 1
Iron
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?