Telerik Forums
UI for ASP.NET AJAX Forum
2 answers
140 views
Situation,
  I have a hierarchy grid where in the nested grid a link pops up a modal pop-up so the user can edit all of the contents of the object, the nested grid only shows a selected portion.  upon saving all is good except the nested grid, I cannot seem to figure out how to refresh it, unless I reload the entire page which I guess would work but not preferable.  would like to just refresh the nested grid but will settle for the whole grid if need be.


Aspx Code:

<asp:UpdatePanel ID="upnlGrid" runat="server" UpdateMode="Conditional"
<ContentTemplate> 
    <telerik:RadGrid ID="UnitList" runat="server" AutoGenerateColumns="False"  
        DataSourceID="UnitDataSource" GridLines="None"   
         Skin="Windows7"
<MasterTableView datakeynames="Id" datasourceid="UnitDataSource"
    <DetailTables> 
        <telerik:GridTableView runat="server" DataKeyNames="Id"  
            CssClass="GridBackground"
            <RowIndicatorColumn> 
                <HeaderStyle Width="20px" /> 
            </RowIndicatorColumn> 
            <ExpandCollapseColumn> 
                <HeaderStyle Width="20px" /> 
            </ExpandCollapseColumn> 
            <Columns> 
                <telerik:GridTemplateColumn DataField="Title" HeaderText="Title"  
                    UniqueName="LTitle"
                    <ItemTemplate> 
                        <asp:LinkButton ID="lbtnLTitle" CommandArgument='<%# DataBinder.Eval(Container.DataItem, "Id")%>' runat="server" OnClick="lbtnLTitle_Click" Text='<%# DataBinder.Eval(Container.DataItem, "Title") %>'></asp:LinkButton> 
                    </ItemTemplate> 
                </telerik:GridTemplateColumn> 
                <telerik:GridBoundColumn DataField="Presenter" HeaderText="Presenter"  
                    UniqueName="LPresenter"
                </telerik:GridBoundColumn> 
                <telerik:GridBoundColumn DataField="Location" HeaderText="Location"  
                    UniqueName="LLocation"
                </telerik:GridBoundColumn> 
                <telerik:GridBoundColumn DataField="Hours" HeaderText="Hours"  
                    UniqueName="LHours"
                </telerik:GridBoundColumn> 
                <telerik:GridCheckBoxColumn DataField="IsActive" DataType="System.Boolean"  
                    HeaderText="Active" UniqueName="LIsActive"
                </telerik:GridCheckBoxColumn> 
            </Columns> 
        </telerik:GridTableView> 
    </DetailTables> 
<RowIndicatorColumn> 
<HeaderStyle Width="20px"></HeaderStyle> 
</RowIndicatorColumn> 
<ExpandCollapseColumn visible="True"
<HeaderStyle Width="20px"></HeaderStyle> 
</ExpandCollapseColumn> 
    <Columns> 
        <telerik:GridTemplateColumn DataField="Title" HeaderText="Title"  
            UniqueName="UTitle"
             <ItemTemplate> 
                        <asp:LinkButton ID="lbtnUTitle" CommandArgument='<%# DataBinder.Eval(Container.DataItem, "Id")%>' runat="server" OnClick="lbtnUTitle_Click" Text='<%# DataBinder.Eval(Container.DataItem, "Title") %>'></asp:LinkButton> 
                    </ItemTemplate> 
        </telerik:GridTemplateColumn> 
        <telerik:GridBoundColumn DataField="OfferDept" HeaderText="Offer Dept."  
            UniqueName="UOfferDept"
        </telerik:GridBoundColumn> 
        <telerik:GridBoundColumn DataField="Semester" HeaderText="Semester"  
            UniqueName="USemester"
        </telerik:GridBoundColumn> 
        <telerik:GridBoundColumn DataField="Type" HeaderText="Type" UniqueName="UType"
        </telerik:GridBoundColumn> 
        <telerik:GridBoundColumn DataField="StudentVuNetId" HeaderText="Student Id"  
            UniqueName="UStudentVuNetId"
        </telerik:GridBoundColumn> 
        <telerik:GridBoundColumn DataField="Hours" HeaderText="Hours"  
            UniqueName="UHours"
        </telerik:GridBoundColumn> 
        <telerik:GridCheckBoxColumn DataField="IsActive" DataType="System.Boolean"  
            HeaderText="Active" UniqueName="UIsActive"
        </telerik:GridCheckBoxColumn> 
    </Columns> 
</MasterTableView> 
    </telerik:RadGrid> 
    <asp:ObjectDataSource ID="UnitDataSource" runat="server"  
        SelectMethod="GetAllUnits"  
        TypeName="Vanderbilt.CpmmProg.CommonUtils.UnitManagement"
    </asp:ObjectDataSource> 
</ContentTemplate> 
</asp:UpdatePanel>   


C# Code:
protected void Page_Load(object sender, EventArgs e) 
        { 
             
            //attach the event to build the nested grid 
            UnitList.DetailTableDataBind += new GridDetailTableDataBindEventHandler(UnitList_DetailTableDataBind); 
             
            if (!Page.IsPostBack) 
            { 
                //do some stuff not related to grid at all 
            } 
        } 
 
 
        protected void UnitList_DetailTableDataBind(object source, GridDetailTableDataBindEventArgs e) 
        { 
            int unitId = (int)e.DetailTableView.ParentItem.GetDataKeyValue("Id"); 
            e.DetailTableView.DataSource = UnitManagement.GetUnitLectures(unitId); 
        } 
 
        protected void lbtnLTitle_Click(object sender, EventArgs e) 
        { 
            int Id = Int32.Parse(((LinkButton)sender).CommandArgument.ToString().Trim()); 
             
            //TODO Get data for lecture, populate the updatePanel for editing lectures 
            Lecture lec = LectureManagement.GetLecture(Id); 
            tbTitle.Text = lec.Title; 
            tbPresenter.Text = lec.Presenter; 
            tbLocation.Text = lec.Location; 
            tbHours.Text = lec.Hours.ToString(); 
            tbCourseAdminVuNetId.Text = lec.CourseAdminVuNetId; 
            rdtpTime.SelectedDate = lec.DateAndTime; 
            hfEditLecId.Value = lec.Id.ToString(); 
            cbIsActive.Checked = lec.IsActive; 
            //TODO show modal popup. 
            hfEditLectureDummy_ModalPopupExtender.Show(); 
        } 
 
 
 
        protected void lbtnUTitle_Click(object sender, EventArgs e) 
        { 
             //redirect to another page 
        } 
 
        protected void btnEditCancel_Click(object sender, EventArgs e) 
        { 
            //hide the modal popup 
            hfEditLectureDummy_ModalPopupExtender.Hide(); 
        } 
 
        protected void btnEditSave_Click(object sender, EventArgs e) 
        { 
            //get the lecture 
            //save the lecture to persistence 
 
            //hide modal popup 
            hfEditLectureDummy_ModalPopupExtender.Hide(); 
 
            //update the updatepanel 
            upnlGrid.Update(); 
        } 


thanks,
jms
jms
Top achievements
Rank 1
 answered on 18 Aug 2010
2 answers
80 views
Hi

I would like to know if the add button that appears in the radgrid can be used in other parts of a web page? For instance when you edit a row in the radGrid or Add a new record, I would like to be able to have an add button next to some of the drop downs that may appear in the details section of the radGrid. I would like to use the add button of the current skin

Thanks
drizzo
Dan
Top achievements
Rank 1
 answered on 18 Aug 2010
2 answers
149 views
Hi there

We are creating a site which uses the Docks and Zones from Telerik.

So far we have based our testing on an example provided to use from you guys - 162243_savedockstatedbloadingpanel.vb

Initially we were only concerned with loading dock states from the db - which works very well.

We are now trying to use the 'Add Dock' functionality but have hit a couple of problems....

1> There is a function in the Telerik example:

 

 

Public Function GetZones() As ArrayList

 

 

 

Dim zones As New ArrayList()

 

zones.Add(RadDockZone1)

zones.Add(RadDockZone2)

 

 

Return zones

 

 

 

End Function

 


Although this works in the example when we try to replicate it in our tests this does not populate the drop down list??

2> The save function.....

Protected

 

 

Sub ButtonAddDock_Click(ByVal sender As Object, ByVal e As EventArgs)

 

 

 

Dim dock As RadDock = CreateRadDock()

 

 

 

'find the target zone and add the new dock there

 

 

 

Dim dz As RadDockZone = DirectCast(FindControl(DropDownZone.SelectedItem.Text), RadDockZone)

 

dz.Controls.Add(dock)

CreateSaveStateTrigger(dock)

 

 

'Load the selected widget in the RadDock control

 

dock.Tag = DroptDownWidget.SelectedValue

LoadWidget(dock)

 

 

ScriptManager.RegisterStartupScript(Me, Me.[GetType](), "MoveDock", String.Format("function _moveDock() {{" & vbCr & vbLf & vbTab & vbTab & vbTab & " " & vbTab & "Sys.Application.remove_load(_moveDock);" & vbCr & vbLf & vbTab & vbTab & vbTab & vbTab & " $find('{1}').dock($find('{0}'),{2});" & vbCr & vbLf & vbTab & vbTab & vbTab & " }};" & vbCr & vbLf & vbTab & vbTab & vbTab & " Sys.Application.add_load(_moveDock);", dock.ClientID, DropDownZone.SelectedValue, dz.Docks.Count), True)

 

 

 

End Sub

 


 ...throws an error on this line:

Dim dz As RadDockZone = DirectCast(FindControl(DropDownZone.SelectedItem.Text), RadDockZone)

 

 
saying it cant find the RadDockZone.

Again this works fine on your example but not in our tests.

If I hard code the above line. for example: Dim dz As RadDockZone = RadDockZone1

then it finds the zone but then throws an exception when '$find('{1}').dock($find('{0}'),{2});" ' is called.

It would appear the 2 issues are related and are not due to bad or wrong coding. I think its a page lifecycle issue but cant seem to get to the bottom of it.

Can you help please as we are 90% towards achieving the required functionality.

Shown below is the ASPX and ASPX.VB files...............

-------------------------------------------------------------------------------------------------------
TESTCONTROLPANEL.ASPX

<%

 

@ Page Title="" Language="vb" AutoEventWireup="true" MasterPageFile="~/App_Templates/IFM.Master" CodeBehind="Test Control Panel.aspx.vb" Inherits="IFM_Code_Testing.Test_Control_Panel" ClassName="Test_Control_Panel" %>

 

<%

 

@ Register Assembly="AjaxControlToolkit" Namespace="AjaxControlToolkit" TagPrefix="asp" %>

 

<%

 

@ Register Assembly="Telerik.Web.UI" Namespace="Telerik.Web.UI" TagPrefix="telerik" %>

 

<

 

 

asp:Content ID="Content1" ContentPlaceHolderID="head" runat="server">

 

 

 

<telerik:RadCodeBlock ID="RadCodeBlock1" runat="server">

 

 

 

<script type="text/javascript">

 

 

 

var currentLoadingPanel = null;

 

 

 

var currentUpdatedControl = null;

 

 

 

function RequestStart(sender, args) {

 

currentLoadingPanel = $find(

 

"LoadingPanel1");

 

currentUpdatedControl =

 

"TableLayout";

 

currentLoadingPanel.show(currentUpdatedControl);

}

 

 

function ResponseEnd() {

 

 

 

//hide the loading panel and clean up the global variables

 

 

 

if (currentLoadingPanel != null)

 

currentLoadingPanel.hide(currentUpdatedControl);

currentUpdatedControl =

 

null;

 

currentLoadingPanel =

 

null;

 

}

 

 

</script>

 

 

 

</telerik:RadCodeBlock>

 

</

 

 

asp:Content>

 

<

 

 

asp:Content ID="Content2" ContentPlaceHolderID="ControlPanelHolder" runat="server">

 

<

 

 

div id="ControlPanel">

 

 

 

<asp:Panel ID="TitlePanel" runat="server" >

 

 

 

<asp:Image ID="Image2" runat="server" ImageUrl="~/images/collapse_blue.jpg"/>&nbsp;&nbsp;

 

 

 

<asp:Label ID="Label1" runat="server">Show Control Panel</asp:Label>

 

 

 

</asp:Panel>

 

 

 

<asp:Panel ID="ContentPanel" runat="server" CssClass="ContentPanel" >

 

 

 

<div class="module">

 

Select Module:

 

&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;

 

 

 

<asp:DropDownList runat="server" ID="DroptDownWidget" Width="150">

 

 

 

<asp:ListItem Text="ExchangeRates.ascx" Value="~/Controls/ExchangeRates.ascx" Selected="True"></asp:ListItem>

 

 

 

<asp:ListItem Text="Horoscopes.ascx" Value="~/Controls/Horoscopes.ascx"></asp:ListItem>

 

 

 

<asp:ListItem Text="News.ascx" Value="~/Controls/News.ascx"></asp:ListItem>

 

 

 

<asp:ListItem Text="Weather.ascx" Value="~/Controls/Weather.ascx"></asp:ListItem>

 

 

 

</asp:DropDownList>

 

 

 

<br />

 

Select Docking Zone:

 

 

<asp:DropDownList ID="DropDownZone" runat="server" >

 

 

 

<asp:ListItem Text="RadDockZone1" Value="RadDockZone1" Selected="True"></asp:ListItem>

 

 

 

<asp:ListItem Text="RadDockZone2" Value="RadDockZone2"></asp:ListItem>

 

 

 

<asp:ListItem Text="RadDockZone3" Value="RadDockZone3"></asp:ListItem>

 

 

 

 

</asp:DropDownList>

 

 

 

<br />

 

 

 

<br />

 

 

 

<asp:Button runat="server" CssClass="button" ID="ButtonAddDock" Text="Add Dock (AJAX)"

 

 

 

OnClick="ButtonAddDock_Click" />

 

 

 

</div>

 

 

 

</asp:Panel>

 

 

 

<asp:CollapsiblePanelExtender ID="CollapsiblePanelExtender1" runat="server"

 

 

 

TargetControlID="ContentPanel"

 

 

 

ExpandControlID="TitlePanel"

 

 

 

CollapseControlID="TitlePanel"

 

 

 

Collapsed="true"

 

 

 

AutoExpand="false" TextLabelID="Label1" ExpandedText="Hide Control Panel" CollapsedText="Show Control Panel" ImageControlID="Image2" CollapsedImage="~/images/collapse_blue.jpg" ExpandedImage="~/images/expand_blue.jpg">

 

 

 

</asp:CollapsiblePanelExtender>

 

 

 

 

</div>

 

</

 

 

asp:Content>

 

<

 

 

asp:Content ID="Content3" ContentPlaceHolderID="ContentPlaceHolder2" runat="server">

 

</

 

 

asp:Content>

 

<

 

 

asp:Content ID="Content4" ContentPlaceHolderID="ContentPlaceHolder1" runat="server">

 

<

 

 

asp:Panel ID="Panel1" runat="server">

 

 

 

<telerik:RadDockLayout runat="server" ID="RadDockLayout1" OnSaveDockLayout="RadDockLayout1_SaveDockLayout"

 

 

 

OnLoadDockLayout="RadDockLayout1_LoadDockLayout" EnableEmbeddedSkins="true">

 

 

 

<table id="TableLayout">

 

 

 

<tr>

 

 

 

<td>

 

 

 

<telerik:RadDockZone runat="server" ID="RadDockZone1" Width="280" MinHeight="600">

 

 

 

</telerik:RadDockZone>

 

 

 

</td>

 

 

 

<td>

 

 

 

<telerik:RadDockZone runat="server" ID="RadDockZone2" Width="280" MinHeight="600">

 

 

 

</telerik:RadDockZone>

 

 

 

</td>

 

 

 

<td>

 

 

 

<telerik:RadDockZone runat="server" ID="RadDockZone3" Width="280" MinHeight="600">

 

 

 

</telerik:RadDockZone>

 

 

 

</td>

 

 

 

</tr>

 

 

 

</table>

 

 

 

</telerik:RadDockLayout>

 

 

 

</asp:Panel>

 

 

 

<telerik:RadAjaxManager ID="RadAjaxManager1" runat="server" ClientEvents-OnRequestStart="RequestStart"

 

 

 

ClientEvents-OnResponseEnd="ResponseEnd">

 

<%

 

-- <AjaxSettings>

 

<telerik:AjaxSetting AjaxControlID="ButtonAddDock" EventName="Click">

<UpdatedControls>

<telerik:AjaxUpdatedControl ControlID="Panel1" />

</UpdatedControls>

</telerik:AjaxSetting>

</AjaxSettings>--

 

 

%>

 

 

 

</telerik:RadAjaxManager>

 

 

</

 

 

asp:Content>

 


--------------------------------------------------------------------------------------------------------

TESTCONTROLPANEL.ASPX.VB...........

Public

 

 

Class Test_Control_Panel

 

 

 

Inherits System.Web.UI.Page

 

 

 

Private _conn As New SqlConnection(ConfigurationManager.ConnectionStrings("CONNSTRING").ConnectionString)

 

 

 

Private _userID As Integer = 999999

 

 

 

 

Private ReadOnly Property CurrentDockStates() As List(Of DockState)

 

 

 

Get

 

 

 

Dim dockStatesFromDB As String = ""

 

_conn.Open()

 

 

Dim command As New SqlCommand("select state from IFM_User_Page_Layout where UserID='" + _userID.ToString() + "'", _conn)

 

dockStatesFromDB = command.ExecuteScalar().ToString()

_conn.Close()

 

 

Dim _currentDockStates As New List(Of DockState)()

 

 

 

Dim stringStates As String() = dockStatesFromDB.Split("|"c)

 

 

 

For Each stringState As String In stringStates

 

 

 

If stringState.Trim() <> String.Empty Then

 

_currentDockStates.Add(

 

DockState.Deserialize(stringState))

 

 

 

End If

 

 

 

Next

 

 

 

Return _currentDockStates

 

 

 

End Get

 

 

 

End Property

 

 

 

Protected Sub Page_Load(ByVal sender As Object, ByVal e As EventArgs)

 

 

 

If Not IsPostBack Then

 

 

 

End If

 

 

 

End Sub

 

 

 

Public Function GetZones() As ArrayList

 

 

 

Dim zones As New ArrayList()

 

zones.Add(RadDockZone1)

zones.Add(RadDockZone2)

 

 

Return zones

 

 

 

End Function

 

 

 

Protected Sub Page_Init(ByVal sender As Object, ByVal e As EventArgs)

 

 

 

Dim i As Integer = 0

 

 

 

While i < CurrentDockStates.Count

 

 

 

If CurrentDockStates(i).Closed = False Then

 

 

 

Dim dock As RadDock = CreateRadDockFromState(CurrentDockStates(i))

 

CreateSaveStateTrigger(dock)

 

 

'Load the selected widget

 

LoadWidget(dock)

RadDockLayout1.Controls.Add(dock)

 

 

End If

 

System.

 

Math.Max(System.Threading.Interlocked.Increment(i), i - 1)

 

 

 

End While

 

 

 

End Sub

 

 

 

Protected Sub RadDockLayout1_LoadDockLayout(ByVal sender As Object, ByVal e As DockLayoutEventArgs)

 

 

 

For Each state As DockState In CurrentDockStates

 

e.Positions(state.UniqueName) = state.DockZoneID

e.Indices(state.UniqueName) = state.Index

 

 

Next

 

 

 

End Sub

 

 

 

Protected Sub RadDockLayout1_SaveDockLayout(ByVal sender As Object, ByVal e As DockLayoutEventArgs)

 

 

 

Dim stateList As List(Of DockState) = RadDockLayout1.GetRegisteredDocksState()

 

 

 

Dim serializedList As New StringBuilder()

 

 

 

Dim i As Integer = 0

 

 

 

While i < stateList.Count

 

serializedList.Append(stateList(i).ToString())

serializedList.Append(

 

"|")

 

System.

 

Math.Max(System.Threading.Interlocked.Increment(i), i - 1)

 

 

 

End While

 

 

 

Dim dockState As String = serializedList.ToString()

 

 

 

If dockState.Trim() <> [String].Empty Then

 

_conn.Open()

 

 

Dim command As New SqlCommand([String].Format("update IFM_User_Page_Layout set state='{0}' where UserID='" + _userID.ToString() + "'", dockState), _conn)

 

command.ExecuteNonQuery()

_conn.Close()

 

 

End If

 

 

 

End Sub

 

 

 

Private Function CreateRadDockFromState(ByVal state As DockState) As RadDock

 

 

 

Dim dock As New RadDock()

 

dock.DockMode =

 

DockMode.Docked

 

dock.ID =

 

String.Format("RadDock{0}", state.UniqueName)

 

dock.ApplyState(state)

dock.Commands.Add(

 

New DockCloseCommand())

 

dock.Commands.Add(

 

New DockExpandCollapseCommand())

 

 

 

Return dock

 

 

 

End Function

 

 

 

Private Function CreateRadDock() As RadDock

 

 

 

Dim docksCount As Integer = CurrentDockStates.Count

 

 

 

Dim dock As New RadDock()

 

dock.DockMode =

 

DockMode.Docked

 

dock.UniqueName =

 

Guid.NewGuid().ToString()

 

dock.ID =

 

String.Format("RadDock{0}", dock.UniqueName)

 

dock.Title =

 

"Dock"

 

dock.Text =

 

String.Format("Added at {0}", DateTime.Now)

 

dock.Width =

 

Unit.Pixel(300)

 

dock.Commands.Add(

 

New DockCloseCommand())

 

dock.Commands.Add(

 

New DockExpandCollapseCommand())

 

 

 

Return dock

 

 

 

End Function

 

 

 

Private Sub CreateSaveStateTrigger(ByVal dock As RadDock)

 

dock.AutoPostBack =

 

True

 

dock.CommandsAutoPostBack =

 

True

 

 

 

Dim updatedControl As New AjaxUpdatedControl()

 

updatedControl.ControlID =

 

"Panel1"

 

 

 

Dim setting1 As New AjaxSetting(dock.ID)

 

setting1.EventName =

 

"DockPositionChanged"

 

setting1.UpdatedControls.Add(updatedControl)

 

 

Dim setting2 As New AjaxSetting(dock.ID)

 

setting2.EventName =

 

"Command"

 

setting2.UpdatedControls.Add(updatedControl)

RadAjaxManager1.AjaxSettings.Add(setting1)

RadAjaxManager1.AjaxSettings.Add(setting2)

 

 

End Sub

 

 

 

 

Protected Sub ButtonAddDock_Click(ByVal sender As Object, ByVal e As EventArgs)

 

 

 

Dim dock As RadDock = CreateRadDock()

 

 

 

'find the target zone and add the new dock there

 

 

 

Dim dz As RadDockZone = DirectCast(FindControl(DropDownZone.SelectedItem.Text), RadDockZone)

 

dz.Controls.Add(dock)

CreateSaveStateTrigger(dock)

 

 

'Load the selected widget in the RadDock control

 

dock.Tag = DroptDownWidget.SelectedValue

LoadWidget(dock)

 

 

ScriptManager.RegisterStartupScript(Me, Me.[GetType](), "MoveDock", String.Format("function _moveDock() {{" & vbCr & vbLf & vbTab & vbTab & vbTab & " " & vbTab & "Sys.Application.remove_load(_moveDock);" & vbCr & vbLf & vbTab & vbTab & vbTab & vbTab & " $find('{1}').dock($find('{0}'),{2});" & vbCr & vbLf & vbTab & vbTab & vbTab & " }};" & vbCr & vbLf & vbTab & vbTab & vbTab & " Sys.Application.add_load(_moveDock);", dock.ClientID, DropDownZone.SelectedValue, dz.Docks.Count), True)

 

 

 

End Sub

 

 

 

Private Sub LoadWidget(ByVal dock As RadDock)

 

 

 

If String.IsNullOrEmpty(dock.Tag) Then

 

 

 

Return

 

 

 

End If

 

 

 

Dim widget As Control = LoadControl(dock.Tag)

 

dock.ContentContainer.Controls.Add(widget)

 

 

End Sub

 

 

 

 

 

End

 

 

Class

 



Geoff
Top achievements
Rank 1
 answered on 18 Aug 2010
1 answer
90 views
Good Day All

My datasource is a List as defined like this

public List<EAV> GetRecords(List<string> ParentRecords, List<string> ChildRecords)
{
    List<EAV> Final = new List<EAV>();
 
    for (int i = 0; i < ParentRecords.Count; i++)
    {
        //Put a check for child records exists and add
        Final.Add(new EAV(ParentRecords[i], ChildRecords[0]));
        //Start looping from 2nd J = 1 instead of 0
        for (int J = 1; J < ChildRecords.Count; J++)
        {
            //remove ParentRecords[i]
            Final.Add(new EAV("", ChildRecords[J]));
        }
    }
 
    return Final;
}

And as you can see it brings back a list. Now this will arrange everything in hiearchial form but i need to be able to collapse and uncollase the results , but now it shows in a Grid as normal data as depicted in the image below


Thanks



Schlurk
Top achievements
Rank 2
 answered on 18 Aug 2010
1 answer
213 views
We are using the snippets dropdown to add custom values to html based letters/emails.  The Names text in the dropdowns are getting long and I would like to increase the width of the dropdown to accommodate the longer names.  Here is our usage. 

<td valign="middle" colspan="2">
<AesopControls:AesopRadEditor runat="server" ID="E"
Content='<%# Bind("LetterHtml") %>' 
SkinID="LetterEditor" Height="400px"
ImageCatalogDefaultDirectory="Client"
>
<Snippets>
<telerik:EditorSnippet Name="<span style='color:red;'>---Project---</span>" Value="" />
<telerik:EditorSnippet Name="Project Name" Value="{ProjectName}" />
<telerik:EditorSnippet Name="Project Date" Value="{ProjectDate}" />
Cori
Top achievements
Rank 2
 answered on 18 Aug 2010
2 answers
365 views
This could just be my ignorance on how the RadAjaxManager/client-side action works, but I'm having a problem getting the Combo Box selected value to change in a specific scenario using the RadAjaxManager.

In this demo, I'm just trying to set the third combo to whatever index the second one is set to.  This is not a desired production action, just a way to test whether the index is actually changing or not.  In all cases, the third combo includes more than the number of items in the second combo.

Using this code, the third combo box refreshes correctly, but I'm having the whole page refresh each time, as a result of the AutoPostBack's:

Default4.aspx.vb
Partial Class Default4
    Inherits System.Web.UI.Page
  
    Protected Sub cboInterventionTools_SelectedIndexChanged(ByVal o As Object, ByVal e As Telerik.Web.UI.RadComboBoxSelectedIndexChangedEventArgs) Handles cboInterventionTools.SelectedIndexChanged
  
        cboInterventionDurations.SelectedIndex = cboInterventionTools.SelectedIndex
  
    End Sub
  
End Class


Default4.aspx
<%@ Page Language="VB" AutoEventWireup="false" CodeFile="Default4.aspx.vb" Inherits="Default4" %>
  
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
  
<head runat="server">
    <title></title>
</head>
<body>
    <form id="form1" runat="server">
  
        <asp:ScriptManager ID="ScriptManager1" runat="server">
        </asp:ScriptManager>
  
  
        <div>
  
            <asp:Panel ID="pnlMain" runat="server">
  
                Areas of Concern<br />
                <asp:SqlDataSource ID="sqlAreasOfConcern" runat="server" 
                    ConnectionString="<%$ ConnectionStrings:RTIDesktop %>" 
                    SelectCommand="AreasOfConcern_List" SelectCommandType="StoredProcedure">
                    <SelectParameters>
                        <asp:Parameter DefaultValue="1" Name="ContentAreaID" />
                    </SelectParameters>
                </asp:SqlDataSource>                                        
                <telerik:RadComboBox AutoPostBack="true" Height="300px" Width="200px" runat="server"
                    ID="cboAreasOfConcern" 
                    DataSourceID="sqlAreasOfConcern" DataTextField="AreaOfConcernName" 
                    DataValueField="AreaOfConcernID" ExpandDelay="0">
                </telerik:RadComboBox>
                <br />
              
                Intervention Tool<br />
                <asp:SqlDataSource ID="sqlInterventionTools" runat="server" 
                    ConnectionString="<%$ ConnectionStrings:RTIDesktop %>" 
                    SelectCommand="InterventionTools_List" SelectCommandType="StoredProcedure">
                    <SelectParameters>
                        <asp:Parameter DefaultValue="28172" Name="PersonID" />
                        <asp:ControlParameter ControlID="cboAreasOfConcern" Name="AreaOfConcernID" 
                            PropertyName="SelectedValue" />
                        <asp:Parameter DefaultValue="8" Name="GradeLevelID" />
                        <asp:Parameter DefaultValue="1" Name="DummyParameter" />
                    </SelectParameters>
                </asp:SqlDataSource>                                        
                <telerik:RadComboBox AutoPostBack="true" Height="300px" Width="200px" runat="server"
                    ID="cboInterventionTools" 
                    DataSourceID="sqlInterventionTools" DataTextField="InterventionToolName" 
                    DataValueField="InterventionToolID" ExpandDelay="0">
                </telerik:RadComboBox>
                <br />
  
                Intervention Duration<br />
                <asp:SqlDataSource ID="sqlInterventionDurations" runat="server" 
                    ConnectionString="<%$ ConnectionStrings:RTIDesktop %>" 
                    SelectCommand="InterventionDurations_List" SelectCommandType="StoredProcedure">
                </asp:SqlDataSource>                                        
                <telerik:RadComboBox Height="300px" Width="200px" runat="server"
                    ID="cboInterventionDurations" 
                    DataSourceID="sqlInterventionDurations" DataTextField="InterventionDurationName" 
                    DataValueField="InterventionDurationID" ExpandDelay="0">
                </telerik:RadComboBox>
                <br />
          
            </asp:Panel>
              
        </div>
  
    </form>
</body>
</html>

Everything works great, the cboInterventionTools_SelectedIndexChanged() routine runs, and the cboInterventionDurations.SelectedIndex gets changed correctly.

If I add RadAjaxManager functionality, so that the screen doesn't refresh, the routine runs, but the combo control does not refresh:

Code added to Default4.aspx:
(right after the ScriptManager)
<telerik:RadAjaxManager ID="RadAjaxManager1" runat="server">
    <AjaxSettings>
        <telerik:AjaxSetting AjaxControlID="cboAreasOfConcern">
            <UpdatedControls>
                <telerik:AjaxUpdatedControl ControlID="cboInterventionTools" />
            </UpdatedControls>
        </telerik:AjaxSetting>
    </AjaxSettings>
</telerik:RadAjaxManager>

The idea is that any change to "Areas of Concern" automatically refreshes the "Intervention Tool", client-side. 

I need to be able to change the "Intervention Duration" to reflect a specific default duration time per tool.  It needs to make a call to SQL to determine that information.  If I embed that code into the cboInterventionTools_SelectedIndexChanged() routine, it all runs, and it even SETS the index correctly... but the control never changes visually on the screen.

Is there something I need to do to trigger that combo refresh, client-side, once the routine has completed?
Cartoon Head
Top achievements
Rank 1
 answered on 18 Aug 2010
2 answers
120 views
Hi,
I need to create a number of simple pages to display grid-like data, and using a Declarative Data Source (with SqlDataSource) seems like a good idea to save time. But I cannot be sure that the data source is ready at all times. In that case I'd like to simply display an empty grid.

Any suggestions, can (login) errors easily be trapped at some point?
Thanks.

Best,
Olav
olav
Top achievements
Rank 1
 answered on 18 Aug 2010
1 answer
157 views
Hi -

I have a column in the database that has repeating values.  I'm using that column to populate a ComboBox on my page.  I don't want the repeated values to show up, but just the one time. 

Example:

1940
1940
1940
1950
1950
1960
1970
1970
1970

So, I only want this to be populated in the ComboBox:
1940
1950
1960
1970

Is there a parameter or keyword that can be used on the aspx side or the c# side that can give me the outcome I need?

Here is my c#:
private void PopulateComboBox()
{
  IQueryable allSystemPlantAccount = system_PlantAccount.GetAllBindings();
  this.systemPlantAccountRadComboBox.DataSource = allSystemPlantAccount;
  this.systemPlantAccountRadComboBox.DataValueField = "ID";
  this.systemPlantAccountRadComboBox.DataTextField = "Year";
  this.systemPlantAccountRadComboBox.DataBind();
  this.systemPlantAccountRadComboBox.Filter = RadComboBoxFilter.Contains;
  this.systemPlantAccountRadComboBox.Sort = RadComboBoxSort.Ascending;
  this.systemPlantAccountRadComboBox.SortItems();
}

Here is my aspx:
<telerik:RadComboBox ID="systemPlantAccountRadComboBox" runat="server" Width="200px"
      style="left: 20px; top: 125px; position: absolute; text-align: right;"></telerik:RadComboBox>

Any help would be great.  Thanks!

wen
Cori
Top achievements
Rank 2
 answered on 18 Aug 2010
1 answer
181 views
Hello everybody!

i must admit that i started using telerik components just  recently. Right now i'm trying to use the GridAttachmentColumn to manage my attachments.

but i keep getting this error on insert "

Implicit conversion from data type sql_variant to varbinary(max) is not allowed. Use the CONVERT function to run this query

"
I use sqlserver 2005 .

so i ask, shouldnt  the GridAttachmentColumn suffice to work with the datasource? Or do i have to use a gridTemplateColumn?


thanx!
joao
Top achievements
Rank 1
 answered on 18 Aug 2010
1 answer
159 views
In an older version of the RadMenu (v 3.6.4.0), I was able to load my xml data into a radmenu inside of a skin.

Skin syntax:

<telerik:RadMenu

    runat="server"

    SkinID="EditCommandMenu"

    Width="100%"

    ClickToOpen="true"

    CausesValidation="false"

    AccessibilityEnabled="True"

    AutoPostBack="false"

    ContentFile="~/PresentationLayer/Manifests/Menu/Edit/Commands.xml"

    ImagesBaseDir="~/PresentationLayer/Images/Menu/Default" />

I am in the process of upgrading to the latest version and this functionality seems to be removed.
Does anyone know how to inject my XML into a Menu via a Skin?

Thanks!

Schlurk
Top achievements
Rank 2
 answered on 18 Aug 2010
Narrow your results
Selected tags
Tags
+? more
Top users last month
Hiba
Top achievements
Rank 1
Iron
Iron
Rob
Top achievements
Rank 3
Bronze
Bronze
Iron
Max
Top achievements
Rank 1
Veteran
Iron
Alina
Top achievements
Rank 1
Rakhee
Top achievements
Rank 1
Iron
Iron
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
Hiba
Top achievements
Rank 1
Iron
Iron
Rob
Top achievements
Rank 3
Bronze
Bronze
Iron
Max
Top achievements
Rank 1
Veteran
Iron
Alina
Top achievements
Rank 1
Rakhee
Top achievements
Rank 1
Iron
Iron
Iron
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?