Telerik Forums
UI for ASP.NET AJAX Forum
3 answers
117 views

I’m trying to use the RadGrid in a Page with disabled ViewState.

 

<%@ Page Language="C#" AutoEventWireup="true" EnableViewState="false" %>

 

Here’s my scenario:

·         My page contains a RadGrid with  EditMode="EditForms" and a  <rad:GridEditCommandColumn /> column.

·         When clicking on this column, the edition starts as it should.

·         On the next postback – might be not even due to a grid event – the grid “forgot” is has entered edit mode and the form is not displayed anymore.

 

I understand the behaviour since I’ve deactivated the ViewState. I’d like to maintain this information in the server in a custom way. My question is how do I hook the grid’s server-side events to tell it that it is in edit mode ?

 

I’ve found the following example on your community site:

 

http://www.telerik.com/community/code-library/submission/b311D-tgtkd.aspx

 

Although this example does not rely on the ViewState for the current data of the grid, it relies on the ViewState for the “edit” mode.

 

Thanks

Rosen
Telerik team
 answered on 06 Nov 2008
0 answers
93 views
I have RadControls for ASP.NET Q2 2008 installed. I don't appear to see the column GridDateTimeColumn implemented?

Is there no way with these tools to implement a DateTime column within the RadGrid ?

Thanks,

Julian

***********UPDATE**************
Ok, I see that the new version of the controls support this column and apparently my version does not. I answered my own question. Thx.
Julian
Top achievements
Rank 1
 asked on 06 Nov 2008
4 answers
163 views
Just wanted to say the new site looks totally cool and excellent!

Keep up the great work,

Steve
Martin de Ruiter
Top achievements
Rank 2
 answered on 06 Nov 2008
6 answers
217 views
Hello,

how can I create a ItemTemplate on server-side?

I tryed to add it in the OnInit method like this: 

public

 

class FilterPanel : FilterPanelBase {

 

protected override void OnInit(EventArgs e)

{

 

FilterPanelTemplate t = new FilterPanelTemplate();

 

 

Control myContainer = new Control();

t.InstantiateIn(myContainer);

 

this.ItemTemplate = t;
base.OnInit(e);

}

}

 

public

 

class FilterPanelTemplate : ITemplate

 

{

public void InstantiateIn(Control container)

{

 

TextBox _filterInput = new TextBox();

_filterInput.ID =

"_filterInput";

 

_filterInput.Text =

"Suchbegriff...";

 

container.Controls.Add(_filterInput);

}

}

 

It doesn't work.

Thanks for help.
Rahel
Top achievements
Rank 1
 answered on 06 Nov 2008
3 answers
189 views
Hi,

I'm try the telerik component 2008 Q2. i'm using vs2005. i try from the example of telerik, which is RadGrid -> Insert/Update/Delete -> Extracting Values -> Using Column Editor. i never can to updating data, even when i try to update data from the telerik example. the data only update on the web, but when i close the browser and load the example again, the data back to normal (no changes). this happen also in my project. i already follow all the instruction from the example, but still can't update the data. is there something missing?
here my aspx code:

<

telerik:RadAjaxManager ID="RadAjaxManager1" runat="server">

 

 

<AjaxSettings>

 

 

<telerik:AjaxSetting AjaxControlID="RadGrid1">

 

 

<UpdatedControls>

 

 

<telerik:AjaxUpdatedControl ControlID="RadGrid1" />

 

 

</UpdatedControls>

 

 

</telerik:AjaxSetting>

 

 

</AjaxSettings>

 

 

</telerik:RadAjaxManager>

 

 

<telerik:RadGrid ID="RadGrid1" Skin="Default" runat="server" Width="45%" GridLines="None"

 

 

AutoGenerateColumns="False" PageSize="10" AllowSorting="True" AllowPaging="True"

 

 

ShowStatusBar="true">

 

 

<PagerStyle Mode="NumericPages"></PagerStyle>

 

 

<MasterTableView DataKeyNames="id_divisi" AllowMultiColumnSorting="True" Width="100%"

 

 

CommandItemDisplay="Top">

 

 

<Columns>

 

 

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

 

 

<telerik:GridEditCommandColumn UpdateText="Update" UniqueName="EditCommandColumn"

 

 

CancelText="Cancel" EditText="Edit">

 

 

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

 

 

</telerik:GridEditCommandColumn>

 

 

<telerik:GridBoundColumn UniqueName="nama_divisi" SortExpression="nama_divisi" HeaderText="Nama Divisi"

 

 

DataField="nama_divisi" />

 

 

<telerik:GridBoundColumn UniqueName="keterangan" SortExpression="keterangan" HeaderText="Keterangan"

 

 

DataField="keterangan" />

 

 

</Columns>

 

 

<EditFormSettings CaptionFormatString="Edit Divisi ID {0}" CaptionDataField="id_divisi">

 

 

<FormTableItemStyle Width="100%" Height="29px"></FormTableItemStyle>

 

 

<FormTableStyle GridLines="None" CellSpacing="0" CellPadding="2"></FormTableStyle>

 

 

<FormStyle Width="100%" BackColor="#eef2ea"></FormStyle>

 

 

<EditColumn ButtonType="ImageButton" />

 

 

</EditFormSettings>

 

 

</MasterTableView>

 

 

</telerik:RadGrid>

 


and this is my code behind:


Partial

Class Master_divisi

 

 

Inherits System.Web.UI.Page

 

 

Dim cs As String = ConfigurationManager.ConnectionStrings("CsTs").ConnectionString

 

 

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

 

 

If Not IsPostBack Then

 

RadGrid1.MasterTableView.EditMode = GridEditMode.EditForms

 

End If

 

 

End Sub

 

 

Public ReadOnly Property DivisiData() As DataSet

 

 

Get

 

 

Dim obj As Object = Me.Session("DivisiData")

 

 

If Not obj Is Nothing Then

 

 

Return CType(obj, DataSet)

 

 

End If

 

 

Dim MyDivisiData As DataSet = New DataSet

 

 

Dim ConnString As String = cs

 

 

Dim conn As SqlConnection = New SqlConnection(ConnString)

 

 

Dim adapter As SqlDataAdapter = New SqlDataAdapter

 

adapter.SelectCommand =

New SqlCommand("SELECT id_divisi, nama_divisi, keterangan FROM tbl_divisi", conn)

 

adapter.Fill(MyDivisiData,

"tbl_divisi")

 

 

Me.Session("DivisiData") = MyDivisiData

 

 

Return MyDivisiData

 

 

End Get

 

 

End Property

 

 

Protected Sub RadGrid1_NeedDataSource(ByVal source As Object, ByVal e As Telerik.Web.UI.GridNeedDataSourceEventArgs) Handles RadGrid1.NeedDataSource

 

RadGrid1.DataSource =

Me.DivisiData

 

 

Me.DivisiData.Tables("tbl_divisi").PrimaryKey = New DataColumn() {Me.DivisiData.Tables("tbl_divisi").Columns("id_divisi")}

 

 

End Sub

 

 

Private Sub RadGrid1_UpdateCommand(ByVal source As System.Object, ByVal e As Telerik.Web.UI.GridCommandEventArgs) Handles RadGrid1.UpdateCommand

 

 

Dim editedItem As GridEditableItem = CType(e.Item, GridEditableItem)

 

 

Dim editMan As GridEditManager = editedItem.EditManager

 

 

Dim column As GridColumn

 

 

For Each column In e.Item.OwnerTableView.Columns

 

 

If TypeOf column Is IGridEditableColumn Then

 

 

Dim editableCol As IGridEditableColumn = CType(column, IGridEditableColumn)

 

 

If (editableCol.IsEditable) Then

 

 

Dim editor As IGridColumnEditor = editMan.GetColumnEditor(editableCol)

 

 

Dim editorType As String = CType(editor, Object).ToString()

 

 

Dim editorText As String = "unknown"

 

 

Dim editorValue As Object = Nothing

 

 

If (TypeOf editor Is GridTextColumnEditor) Then

 

editorText =

CType(editor, GridTextColumnEditor).Text

 

editorValue =

CType(editor, GridTextColumnEditor).Text

 

 

End If

 

 

If (TypeOf editor Is GridBoolColumnEditor) Then

 

editorText =

CType(editor, GridBoolColumnEditor).Value.ToString()

 

editorValue =

CType(editor, GridBoolColumnEditor).Value

 

 

End If

 

 

If (TypeOf editor Is GridDropDownColumnEditor) Then

 

editorText =

CType(editor, GridDropDownColumnEditor).SelectedText & "; " & CType(editor, GridDropDownColumnEditor).SelectedValue

 

editorValue =

CType(editor, GridDropDownColumnEditor).SelectedValue

 

 

End If

 

 

Try

 

 

Dim changedRows As DataRow() = Me.DivisiData.Tables("tbl_divisi").Select("id_divisi = " & editedItem.OwnerTableView.DataKeyValues(editedItem.ItemIndex)("id_divisi"))

 

changedRows(0)(column.UniqueName) = editorValue

 

Me.DivisiData.Tables("tbl_divisi").AcceptChanges()

 

 

Catch ex As Exception

 

RadGrid1.Controls.Add(

New LiteralControl("<strong>Unable to set value of column '" & column.UniqueName & "'</strong> - " + ex.Message))

 

e.Canceled =

True

 

 

End Try

 

 

End If

 

 

End If

 

 

Next

 

RadGrid1.MasterTableView.Rebind()

 

End Sub

 

 

Protected Sub Page_PreRender(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.PreRender

 

 

If Not MyBase.IsPostBack Then

 

 

Me.RadGrid1.MasterTableView.Rebind()

 

 

End If

 

 

End Sub

 

End

Class

 

Please help me.

thanks
peper
Peper
Top achievements
Rank 1
 answered on 06 Nov 2008
1 answer
100 views
How do I position the cursor between the custom HTML tags that I paste back into the editor? It appears that upon closing the dialogue, the cursor is always at the end.
Rumen
Telerik team
 answered on 06 Nov 2008
1 answer
95 views
Can some tell me the difference between the standard AJAX ASP.net RadEditor and the MOSS version?

Currently we have a licence for the standard RadControls.  I am working on a WSS site and would like to use the RadEditor. 
  • Can I use the standard one or do I need to purchase the MOSS version? 
  • Does the MOSS version have any benefits? 
  • Do I need to pay full licence price for the MOSS version if I already have a licence for the RadEditor?
Thanks
Rumen
Telerik team
 answered on 06 Nov 2008
4 answers
294 views
I have a website that uses the ASP login system and make use of a few membership roles.

I'd like to be able to have some of the pages linked on my RadMenu to be greyed out for certain users based on their role.


Is this possible?


I can give more detail if necessary.
Megan Airs
Top achievements
Rank 1
 answered on 06 Nov 2008
1 answer
95 views
I have almost finished a web project that uses some controls from the radControls for ASP.NET. My company recently purchased the tools for ASP.NET AJAX. We don't have the time currently to update the controls to the newer versions for this particular application, but I would like to include the tooltip control so I can do a modal popup.

I have not installed the tools ASP.NET AJAX, as I'm afraid it may mess with my visual studio 2005 and cause issues with one of my projects since the project uses the original ASP.NET radControls.

Is mixing the two control suites doable? Or should I maybe instead use the ajaxcontroltoolkits ModalPopup? Any suggestions/advice and instructions on how to mix the two radControl suites would be greatly appreciated.

Thanks.
Svetlina Anati
Telerik team
 answered on 06 Nov 2008
2 answers
150 views
When using filtering in the grid does anyone know if there is a way to convert the filter icon into a dropdown list of the valid operators?

Instead of filtering each column when the user selects a filter item, we want to be able to allow them to select the filter values across multiple columns, then do a single postback to the server to get the new filtered data.  When the filter icon is displayed, it is hard to tell if a user has already selected an operator or not for that given column.

Thanks!
Richard
Top achievements
Rank 2
 answered on 06 Nov 2008
Narrow your results
Selected tags
Tags
+? more
Top users last month
Shiori
Top achievements
Rank 2
Iron
Tien
Top achievements
Rank 1
Iron
Robert
Top achievements
Rank 1
Rob
Top achievements
Rank 4
Bronze
Bronze
Iron
Geoff
Top achievements
Rank 1
Want to show your ninja superpower to fellow developers?
Top users last month
Shiori
Top achievements
Rank 2
Iron
Tien
Top achievements
Rank 1
Iron
Robert
Top achievements
Rank 1
Rob
Top achievements
Rank 4
Bronze
Bronze
Iron
Geoff
Top achievements
Rank 1
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?