Telerik Forums
UI for ASP.NET AJAX Forum
2 answers
159 views
Hello,

I think I am trying to accomplish something fairly simple but I can't seem to figure it out.  Hopefully somebody can point me in the right direction.

I have 5 RadGrids within one System.Web.UI.UserControl on an ASPX page.  All 5 RadGrids share the same structure in terms of columns and options by using the same Skin (SkinID="") in my Theme.  They also all share the same DataSource that is a DataView based on a DataTable from a business object.  I am using OnNeedDataSource so that RadGrid can do the binding for me when necessary.

Now what I would like to do, is have all 5 RadGrids remain synchronized in terms of sorting.  So, if the user clicks a column header to sort one of the RadGrids, they all get sorted based on what the user clicked.  So far, I have not been able to figure it out.

Any ideas?
Dean
Top achievements
Rank 1
 answered on 07 May 2009
2 answers
112 views
Hi

  The Format Stripper has five different options to strip out CSS, Font ,Span, Word and All formatting. 

Some of these options do not actually work the way we want it to work for example Css stripper does not strip out in-line CSS.

All our client wants to HIDE OUT all the options except , STRIP ALL FORMATTING. Is it possible to hide all other options except Strip

All formatting?


Kind Regards

Sohail Sarwar



Sohail
Top achievements
Rank 1
 answered on 07 May 2009
2 answers
75 views
I have a table that contains a set of language as follow :

English(US)
English(UK)
French(FR)
French(CA)
etc...

I want to group them in the grid view like this :

 - English
English(US)
English(UK)
+French
.....

Now each row contains data that can be edited like Rate that can be Updated or added.

If the user want to enter a single rate for all English Language he doesn't need to collapse Englsih language, he will just enter the Rate in the Header so All sub language will have the same rate.

For custom rate per Sub-Language he collapse the Language and edit the rate of each sub-language.

This is my main goal.

Any ideas will be highly appreciated.

Thanks a lot.


Yavor
Telerik team
 answered on 07 May 2009
1 answer
88 views
I have a master page:

<div id="sidebar">  
    <WebCore:SideNavigation id="wwcSideNavigation" runat="server"></WorldWebCore:SideNavigation> 
</div> 
 
 
<div id="rightbar">  
    <asp:ContentPlaceHolder ID="cphMain" runat="server"></asp:ContentPlaceHolder> 
</div> 
 

Inside the side navigation control, is a repeater list of li tags, with links:

<href="Default.aspx" class="dashboard">Dashboard</a> 
<ul id="treemenu1" class="treeview">  
      
    <li>Leads Manager  
        <ul> 
            <li><a href="LeadList.aspx">Leads</a></li>  
        </ul> 
    </li> 
    <li>Users Manager  
        <ul> 
            <li>Users</li> 
        </ul> 
    </li> 
</ul> 

LeadList.aspx using the master page above:

 
<asp:Content ID="cphMain" ContentPlaceHolderID="cphMain" runat="server">  
    <asp:Button ID="btnAddNew" runat="server" Text="Add New Lead" CssClass="btn" /> 
    <telerik:RadGrid ID="rgLead" runat="server" Skin="Telerik" AllowMultiRowSelection="true" AllowPaging="True" AllowSorting="True" GridLines="None" OnItemCreated="rgLead_onItemCreated" OnItemCommand="rgLead_OnItemCommand" CssClass="gridview">  
    <MasterTableView TableLayout="Fixed" AutoGenerateColumns="False" DataKeyNames="LeadID"  > 
    <Columns> 
       <telerik:GridClientSelectColumn UniqueName="ClientSelectColumn" HeaderStyle-Width="25px"  /> 
       <telerik:GridTemplateColumn HeaderText="Name" HeaderStyle-Width="150px" ItemStyle-Font-Size="13px" > 
            <ItemTemplate> 
               <asp:Literal ID="ltrName" runat="server"></asp:Literal>&nbsp;&nbsp;  
            </ItemTemplate> 
       </telerik:GridTemplateColumn> 
                                          
         <telerik:GridBoundColumn HeaderStyle-Width="100px"  DataField="LeadId" HeaderText="Lead No"  UniqueName="LeadNo" AllowSorting="true" ItemStyle-Font-Size="13px" ></telerik:GridBoundColumn> 
                                          
          <telerik:GridBoundColumn HeaderStyle-Width="150px"  DataField="PhoneNumber" HeaderText="Phone Number"  UniqueName="PhoneNumber" AllowSorting="true" ItemStyle-Font-Size="13px" ></telerik:GridBoundColumn> 
                                          
         <telerik:GridBoundColumn DataField="DtmUpdated" DataType="System.DateTime" HeaderText="Last Updated" UniqueName="DtmUpdated" ItemStyle-Font-Size="13px" ></telerik:GridBoundColumn> 
           
          <telerik:GridTemplateColumn HeaderText="Actions" ItemStyle-Font-Size="13px" > 
                                            <ItemTemplate> 
                                                <asp:Hyperlink ID="hplEdit" runat="server" Text="Edit" ></asp:Hyperlink> 
         </ItemTemplate> 
      </telerik:GridTemplateColumn> 
                                      
       </Columns> 
        </MasterTableView> 
                                  
       <HeaderContextMenu Skin="Outlook">  
             <CollapseAnimation Type="OutQuint" Duration="200"></CollapseAnimation> 
        </HeaderContextMenu> 
 
       <ClientSettings EnableRowHoverStyle="false">  
            <Selecting AllowRowSelect="True"   /> 
        </ClientSettings> 
 
       <FilterMenu Skin="Outlook">  
             <CollapseAnimation Type="OutQuint" Duration="200"></CollapseAnimation> 
       </FilterMenu> 
       </telerik:RadGrid> 
 
</asp:Content> 

Okay, so what I want to do is to ajaxify the whole thing so that when i click the link in side navigation control, the main content place holder get updated by ajax instead of loading the page. How can I do that?
ManniAT
Top achievements
Rank 2
 answered on 07 May 2009
1 answer
97 views
good day to all expert ,

                      how can i set the width of my specific column in the grid? please help

sample codes is highly appreciated

thanks to all
Princy
Top achievements
Rank 2
 answered on 07 May 2009
6 answers
222 views
Hi, I'm having a problem with the update control. I have some textfields that the user fills in to create a new content, and one of them is an upload field. I have a submit button where I have my insert query and that is working fine, but now I have the code for the upload as well. I would like to be able to use the variable "imagem" as a parameter for my query, but the problem is that I think that the insert is being executed before that variable has the value in it from the upload, and also that the variable is not available inside the procedure. I also tried using "targetFolder" instead of "imagem" but it also doesn't work...
Help please?

namespace Telerik.Web.Examples.Upload.UsingTargetFolder
{

    public partial class CriarConteudo : System.Web.UI.Page
    {
        string targetFolder = string.Empty;
        protected void Page_Load(object sender, EventArgs e)
        {
           
        }

        protected void RadUploadImagem_FileExists(object sender, Telerik.Web.UI.Upload.UploadedFileEventArgs e)
        {
            UploadedFile imagem = e.UploadedFile;
            string targetFolder = Server.MapPath(RadUploadImagem.TargetFolder);
            string targetFileName = Path.Combine(targetFolder, imagem.GetNameWithoutExtension() + imagem.GetExtension());
            imagem.SaveAs(targetFileName);
        }

        protected void Button1_Click(object sender, EventArgs e)
        {
            SqlConnection conn1 = new SqlConnection(System.Configuration.ConfigurationManager.ConnectionStrings["lms_bibliotecaConnectionString1"].ConnectionString);
            SqlCommand cmd1 = new SqlCommand("SELECT IDTipo FROM NL_LMS_BIB_tipos WHERE NL_LMS_BIB_tipos.Tipo = @Param1", conn1);
            cmd1.CommandType = CommandType.Text;
            cmd1.Parameters.Add(new SqlParameter("@Param1", RadioBtnListTipo.SelectedValue));
            Guid idtipo;

                conn1.Open();
                cmd1.ExecuteNonQuery();
                SqlDataReader objDR;
                objDR = cmd1.ExecuteReader();
                objDR.Read();
                idtipo = (Guid)objDR.GetValue(0);

                conn1.Close();
                cmd1.Dispose();
                conn1.Dispose();

            SqlConnection conn2 = new SqlConnection(System.Configuration.ConfigurationManager.ConnectionStrings["lms_bibliotecaConnectionString1"].ConnectionString);
            SqlCommand cmd2 = new SqlCommand("SELECT IDTema FROM NL_LMS_BIB_temas WHERE NL_LMS_BIB_temas.Tema = @Param1", conn2);
            cmd2.CommandType = CommandType.Text;
            cmd2.Parameters.Add(new SqlParameter("@Param1", RadComboTemas.SelectedValue));
            Guid idtema;

                conn2.Open();
                cmd2.ExecuteNonQuery();
                SqlDataReader objDR2;
                objDR2 = cmd2.ExecuteReader();
                objDR2.Read();
                idtema = (Guid)objDR2.GetValue(0);

                conn1.Close();
                cmd1.Dispose();
                conn1.Dispose();

            SqlConnection conn = new SqlConnection(System.Configuration.ConfigurationManager.ConnectionStrings["lms_bibliotecaConnectionString1"].ConnectionString);
            string insertcmd = "INSERT INTO NL_LMS_BIB_conteudos (IDConteudo, Titulo, Resumo, Notas, IDTipo, IDTema, DataPublicacao, Imagem) VALUES (NEWID(), @titulo, @resumo, @notas, @idtipo, @idtema, @datahora, @imagem)";
            SqlCommand cmd = new SqlCommand(insertcmd, conn);
            cmd.Parameters.Add(new SqlParameter("@titulo", RadTxtBoxTitulo.Text));
            cmd.Parameters.Add(new SqlParameter("@resumo", RadTxtBoxResumo.Text));
            cmd.Parameters.Add(new SqlParameter("@idtipo", idtipo));
            cmd.Parameters.Add(new SqlParameter("@idtema", idtema));
            cmd.Parameters.Add(new SqlParameter("@datahora", RadDateTimePicker.SelectedDate));
            cmd.Parameters.Add(new SqlParameter("@notas", RadTxtBoxNotas.Text));
            cmd.Parameters.Add(new SqlParameter("@imagem", targetFolder));

                conn.Open();
                cmd.ExecuteNonQuery();

                conn.Close();
                cmd.Dispose();
                conn.Dispose();

        }
    }
}



Marta
Top achievements
Rank 1
 answered on 07 May 2009
2 answers
153 views
I am really close to getting this to work but I'm missing something. I have it saving the state in our Database but it's not saving the correct order it's just submitting the original layout, not the latest. I'm guesing I am either missing something or have it in the wrong places. Here is the entire code behind.

<CODE>

Imports

 

System

 

Imports

 

System.Collections.Generic

 

Imports

 

System.Data.SqlClient

 

Imports

 

System.Web.Script.Serialization

 

Imports

 

System.Collections

 

Imports

 

Telerik.Web.UI

 

Partial

 

Class portal

 

 

Inherits System.Web.UI.Page

 

 

Private _state As String

 

 

 

Protected Sub Page_Init(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Init

 

 

Dim RoleID As Integer

 

 

Dim drContacts As SqlDataReader

 

 

Dim control As New Web.UI.Control()

 

 

Dim count As Integer = 0

 

RadDockZone1.Controls.Clear()

RadDockZone0.Controls.Clear()

 

RoleID = Int32.Parse(Utilities.GetSession(

"PortalRoleID"))

 

drContacts = PortalDataAccess.GetPortalControlsByRoleID(RoleID)

 

If (drContacts.HasRows) Then

 

 

While (drContacts.Read())

 

 

Dim soRadDock As New RadDock()

 

soRadDock.ID = drContacts(

"ControlID").ToString()

 

soRadDock.Title = drContacts(

"ControlTitle").ToString()

 

control = LoadControl(

"UserControls/" & drContacts("ControlName").ToString() & ".ascx")

 

soRadDock.ContentContainer.Controls.Add(control)

 

 

If drContacts("Zone") = 1 Then

 

RadDockZone1.Controls.Add(soRadDock)

CreateSaveStateTriggers(soRadDock)

 

End If

 

 

If drContacts("Zone") = 0 Then

 

RadDockZone0.Controls.Add(soRadDock)

CreateSaveStateTriggers(soRadDock)

 

End If

 

 

End While

 

drContacts.Close()

 

End If

 

 

End Sub

 

 

Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load

 

RadDockLayout1.Skin = Application(

"TelerikTheme")

 

RadDockZone1.Skin = Application(

"TelerikTheme")

 

RadDockZone1.Skin = Application(

"TelerikTheme")

 

 

 

End Sub

 

 

Private Property CurrentDockStates() As List(Of DockState)

 

 

Get

 

 

Dim _currentDockStates As New List(Of DockState)()

 

 

Dim ContactID As Integer = Int32.Parse(Utilities.GetSession("ContactNumber").ToString())

 

 

If PortalDataAccess.LoadState(ContactID) IsNot Nothing Then

 

_state = PortalDataAccess.LoadState(ContactID).ToString()

 

End If

 

 

If _state Is Nothing Then

 

CurrentDockStates = _currentDockStates

 

Else

 

 

Dim dockStates As String() = _state.Split("|"c)

 

 

For i As Integer = 0 To dockStates.Length - 1

 

 

Dim serializedState As String = dockStates(i)

 

 

If Not String.IsNullOrEmpty(serializedState) Then

 

 

Dim state As DockState = DockState.Deserialize(serializedState)

 

_currentDockStates.Add(state)

 

End If

 

 

Next

 

 

End If

 

 

Return _currentDockStates

 

 

End Get

 

 

Set(ByVal value As List(Of DockState))

 

 

Dim builder As New StringBuilder()

 

 

For i As Integer = 0 To value.Count - 1

 

 

Dim serializedState As String = value(i).ToString() & "|"

 

builder.Append(serializedState).ToString()

 

Next

 

 

Dim ContactID As Integer = Int32.Parse(Utilities.GetSession("ContactNumber").ToString())

 

PortalDataAccess.SaveState(ContactID, builder.ToString())

 

End Set

 

 

End Property

 

 

 

 

Protected Sub RadDockLayout1_SaveDockLayout(ByVal sender As Object, ByVal e As Telerik.Web.UI.DockLayoutEventArgs)

 

 

'Save the dock state in the session. This will enable us to recreate the dock in the next Page_Init.

 

CurrentDockStates = RadDockLayout1.GetRegisteredDocksState()

 

End Sub

 

 

Protected Sub RadDockLayout1_LoadDockLayout(ByVal sender As Object, ByVal e As Telerik.Web.UI.DockLayoutEventArgs)

 

 

For Each state As DockState In CurrentDockStates

 

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

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

 

Next

 

 

 

 

End Sub

 

 

Private Sub CreateSaveStateTriggers(ByVal dock As RadDock)

 

 

'Ensure that the RadDock control will initiate postback

 

 

' when its position changes on the client. Using the

 

 

' trigger we will "ajaxify" that postback.

 

dock.AutoPostBack =

True

 

dock.CommandsAutoPostBack =

True

 

 

Dim saveStateTrigger As New AsyncPostBackTrigger()

 

saveStateTrigger.ControlID = dock.ID

saveStateTrigger.EventName =

"DockPositionChanged"

 

UpdatePanel1.Triggers.Add(saveStateTrigger)

saveStateTrigger =

New AsyncPostBackTrigger()

 

saveStateTrigger.ControlID = dock.ID

saveStateTrigger.EventName =

"Command"

 

UpdatePanel1.Triggers.Add(saveStateTrigger)

 

End Sub

 

 

 

 

 

 

Protected Sub Button2_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles Button2.Click

 

Response.Cookies(

"DockLayout").Value = ""

 

Response.Redirect(

"default.aspx")

 

 

End Sub

 

 

 

 

Protected Sub ButtonAddDock_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles ButtonAddDock.Click

 

 

End Sub

 

End

 

Class

 



</CODE>
Obi-Wan Kenobi
Top achievements
Rank 1
 answered on 07 May 2009
1 answer
114 views
Is there a way to disable the drag and drop functionality in RadDocks? We have role based security where certain users aren't allowed to change the layout. I tried Enable = false but that didn't do anything.

Thanks,
Sam
Obi-Wan Kenobi
Top achievements
Rank 1
 answered on 07 May 2009
3 answers
290 views
I'm trying to use RadDock controls to create a dashboard to host docks. The different dock types (called widgets) are to be shown in a library (list) on a collapsable panel the right side of the screen. To add docks to the dashboard you simply drag-n-drop them from the library into the zone you want.

1. I'm unable to mix RadDockLayout and RadDockZone with a RadSplitter. Is it possible to create a page with a collapsable RadDockZone to act as a "library"?

2. The library zone is programatically populated with docks based on a plugin system (i.e. widgets). When dragged onto a DockZone I want to copy it, not move it. Is this possible?

All RadDock demo's I find populates the zones by clicking a "Add button". I'd find it much more userfriendly to drag an item from a library onto the zone of choice.

Any help is apprecieted.
Obi-Wan Kenobi
Top achievements
Rank 1
 answered on 07 May 2009
2 answers
88 views
Hi,
I have a js-function that sets several values into the window, that is called by the window opened event. This works fine in ie8, but in ie7 & chrome it is called before the window is fully loaded. Any suggestions on how to solve this?
staron
Top achievements
Rank 1
 answered on 07 May 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?