| <%@ Page Language="C#" AutoEventWireup="true" CodeBehind="Default.aspx.cs" Inherits="WebAppTelerikGridProblem._Default" %> | |
| <%@ 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>Problem of Telerik - clientside data changed per javascripotto - fetch on code behind</title> | |
| <script type="text/javascript"> | |
| function pageLoad(sender, args) | |
| { | |
| } | |
| var Rows = null; | |
| var Grid = null; | |
| function RadGridFieldsOnGridCreated(sender, eventArgs) | |
| { | |
| Grid = sender | |
| if (Rows == null) | |
| Rows = Grid.get_masterTableView().get_dataItems(); | |
| } | |
| function RadGridFieldsOnActiveRowChanged(sender, args) | |
| { | |
| if ((sender.get_masterTableView().get_selectedItems().length < 1) || (sender.get_masterTableView().get_selectedItems()[0].get_id() != args.get_id())) | |
| args.get_tableView().selectItem($get(args.get_id())); | |
| } | |
| function RadGridFieldsOnRowSelect(sender, args) | |
| { | |
| // synchronisieirt Select and ActiveRow | |
| var grid = $find(sender.get_id()); | |
| var dataItem = $get(args.get_id()); | |
| var row = grid.get_masterTableView().get_dataItems()[dataItem.rowIndex - 1]; | |
| var cell = grid.get_masterTableView().getCellByColumnUniqueName(row, 'value'); | |
| //shows the correct changed value | |
| alert('value = ' + cell.innerText); | |
| } | |
| function SelectRowNumber(nRowNr) | |
| { | |
| var dataItem = Rows[nRowNr]; | |
| dataItem.set_selected(true); | |
| } | |
| function GetCell(oRow, sCellname) | |
| { | |
| return Grid.get_masterTableView().getCellByColumnUniqueName(oRow, sCellname); | |
| } | |
| function EntryCellValue(oRow, sCellname, sValue) | |
| { | |
| var oCell = GetCell(oRow, sCellname); | |
| if (oCell === null) | |
| return; | |
| if (sValue === '') | |
| oCell.innerHTML = ' '; | |
| else | |
| oCell.innerText = sValue; | |
| } | |
| // Changed the Entrys in the grid - this changed values i need inn code behind | |
| function ButtonChangeGridContent_onclick() | |
| { | |
| EntryCellValue( Rows[0], 'Value', 'AAAAA' ); | |
| EntryCellValue( Rows[1], 'Value', 'BBBBB' ); | |
| } | |
| </script> | |
| </head> | |
| <body> | |
| <form id="form1" runat="server"> | |
| <asp:ScriptManager ID="ScriptManager1" runat="server"> | |
| </asp:ScriptManager> | |
| <div> | |
| <div id="divHeader" style="width:100%; height:35px; border: solid 1px black"> | |
| <center> | |
| <h1 style=" font-family:Arial; font-weight:bolder">Telerik Grid Problem!?!?</h1> | |
| </center> | |
| </div> | |
| <br /> | |
| <div style="width:100%; height:250px; border: solid 1px black"> | |
| <asp:UpdatePanel ID="UpdatePanelGridView" runat="server"> | |
| <ContentTemplate> | |
| <telerik:RadGrid ID="RadGridFieldView" runat="server" | |
| AutoGenerateColumns = "False" | |
| GroupingEnabled = "False" | |
| Width = "97%" | |
| AllowAutomaticUpdates = "true" | |
| MasterTableView-AllowAutomaticUpdates ="true" | |
| HeaderStyle-Font-Bold = "true" AllowAutomaticInserts="True" AllowMultiRowEdit="True" | |
| > | |
| <MasterTableView CommandItemDisplay="None" GridLines="Both" > | |
| <RowIndicatorColumn Visible="True"> | |
| <HeaderStyle Width="20px" /> | |
| </RowIndicatorColumn> | |
| <ExpandCollapseColumn> | |
| <HeaderStyle Width="20px" /> | |
| </ExpandCollapseColumn> | |
| <Columns> | |
| <telerik:GridBoundColumn | |
| DataType = "System.String" | |
| Display = "true" | |
| HeaderText = "Name" | |
| UniqueName = "Name" | |
| DataField = "Name" | |
| > | |
| <HeaderStyle Width="19%" /> | |
| </telerik:GridBoundColumn> | |
| <telerik:GridBoundColumn | |
| DataType = "System.String" | |
| Display = "true" | |
| HeaderText = "Value" | |
| UniqueName = "Value" | |
| DataField = "Value" | |
| > | |
| <HeaderStyle Width="44%" /> | |
| </telerik:GridBoundColumn> | |
| <telerik:GridBoundColumn | |
| DataType = "System.String" | |
| Display = "true" | |
| HeaderText = "State" | |
| UniqueName = "State" | |
| DataField = "State" | |
| > | |
| <HeaderStyle Width="4%" /> | |
| </telerik:GridBoundColumn> | |
| <telerik:GridBoundColumn | |
| DataType = "System.String" | |
| Display = "true" | |
| HeaderText = "Message" | |
| UniqueName = "Message" | |
| DataField = "Message" | |
| > | |
| <HeaderStyle Width="27%" /> | |
| </telerik:GridBoundColumn> | |
| <telerik:GridBoundColumn | |
| DataType = "System.String" | |
| Display = "true" | |
| HeaderText = "MetaData" | |
| UniqueName = "MetaData" | |
| DataField = "MetaData" | |
| > | |
| <HeaderStyle Width="0px" /> | |
| </telerik:GridBoundColumn> | |
| <telerik:GridBoundColumn | |
| DataType = "System.String" | |
| Display = "true" | |
| HeaderText = "Variables" | |
| UniqueName = "Variables" | |
| DataField = "Variables" | |
| > | |
| <HeaderStyle Width="0px" /> | |
| </telerik:GridBoundColumn> | |
| <telerik:GridBoundColumn | |
| DataType = "System.String" | |
| Display = "true" | |
| HeaderText = "Flags" | |
| UniqueName = "Flags" | |
| DataField = "Flags" | |
| > | |
| <HeaderStyle Width="0px" /> | |
| </telerik:GridBoundColumn> | |
| <telerik:GridBoundColumn | |
| DataType = "System.String" | |
| Display = "true" | |
| HeaderText = "OrgValue" | |
| UniqueName = "OrgValue" | |
| DataField = "OrgValue" | |
| > | |
| <HeaderStyle Width="0px" /> | |
| </telerik:GridBoundColumn> | |
| </Columns> | |
| </MasterTableView> | |
| <HeaderStyle Font-Bold="True" /> | |
| <ClientSettings AllowColumnsReorder = "True" | |
| ReorderColumnsOnClient = "True" | |
| AllowKeyboardNavigation = "True" | |
| Selecting-AllowRowSelect = "True" > | |
| <Selecting AllowRowSelect ="True" /> | |
| <ClientEvents OnRowSelected = "RadGridFieldsOnRowSelect" /> | |
| <ClientEvents OnGridCreated = "RadGridFieldsOnGridCreated" /> | |
| <ClientEvents OnRowSelected = "RadGridFieldsOnRowSelect"/> | |
| <Resizing AllowColumnResize ="True" allowrowresize="True" /> | |
| </ClientSettings> | |
| <FilterMenu EnableTheming="True"> | |
| <CollapseAnimation Duration="200" Type="OutQuint" /> | |
| </FilterMenu> | |
| </telerik:RadGrid> | |
| </ContentTemplate> | |
| </asp:UpdatePanel> | |
| </div> | |
| <div id="div1" style="width:100%; height:60px; border: solid 1px black">> | |
| <asp:UpdatePanel ID="UpdatePanel1" runat="server"> | |
| <ContentTemplate> | |
| <asp:Button runat="server" id="ButtonCallback" Text="Callback" onclick="ButtonCallback_Click" /> | |
| | |
| <input id="ButtonChangeGridContent" onclick="return ButtonChangeGridContent_onclick()" type="button" value="Change Grid Content" /> | |
| <asp:TextBox ID="TextBox1" runat="server" BorderStyle="Groove" Height="22px" Width="207px"></asp:TextBox> | |
| </ContentTemplate> | |
| </asp:UpdatePanel> | |
| <br /> | |
| <asp:Button ID="ButtonPostBack" runat="server" Text="PostBack" onclick="ButtonPostBack_Click" /> | |
| </div> | |
| </div> | |
| </form> | |
| </body> | |
| </html> | |
| using System; | |
| using System.Data; | |
| namespace WebAppTelerikGridProblem | |
| { | |
| public partial class _Default : System.Web.UI.Page | |
| { | |
| protected void Page_Load( object sender, EventArgs e ) | |
| { | |
| if ( !IsPostBack ) | |
| { | |
| RadGridFieldView.DataSource = TFields; | |
| RadGridFieldView.DataBind(); | |
| //[TEST] | |
| // test TFields of correct behaivour | |
| TFields.Rows[2]["Value"] = "CCCCCC"; | |
| string sValue1 = TFields.Rows[2]["Value"].ToString(); | |
| TFields.AcceptChanges(); | |
| //[TEST] | |
| string sValue2 = TFields.Rows[2]["Value"].ToString(); | |
| if ( sValue2 != "CCCCCC") | |
| throw new Exception( "Changes on serverside not processed!" ); | |
| } | |
| } | |
| #region --- Table for Grid data ---------------------- | |
| /// <summary> | |
| /// Table for binding data to grid with 3 rows | |
| /// </summary> | |
| /// <value></value> | |
| public DataTable TFields | |
| { | |
| get | |
| { | |
| if( a_tbFields == null ) | |
| { | |
| a_tbFields = new DataTable("TESTTABLE"); | |
| a_tbFields.Columns.Add( "ID", System.Type.GetType( "System.String" ) ); //PrimKey | |
| a_tbFields.Columns.Add( "Name", System.Type.GetType( "System.String" ) ); | |
| a_tbFields.Columns.Add( "Value", System.Type.GetType( "System.String" ) ); | |
| a_tbFields.Columns.Add( "State", System.Type.GetType( "System.String" ) ); | |
| a_tbFields.Columns.Add( "Message", System.Type.GetType( "System.String" ) ); | |
| a_tbFields.Columns.Add( "MetaData", System.Type.GetType( "System.String" ) ); | |
| a_tbFields.Columns.Add( "Variables", System.Type.GetType( "System.String" ) ); | |
| a_tbFields.Columns.Add( "OrgValue", System.Type.GetType( "System.String" ) ); | |
| DataColumn[] columPrimKey = new DataColumn[1]; | |
| columPrimKey[0] = a_tbFields.Columns["ID"]; | |
| a_tbFields.PrimaryKey = columPrimKey; | |
| DataRow dr = a_tbFields.NewRow(); | |
| dr["ID"] = NextPrimKey.ToString(); | |
| dr["Name"] = "N1111"; | |
| dr["Value"] = "V1111"; | |
| dr["State"] = "S1111"; | |
| dr["Message"] = "M1111"; | |
| dr["MetaData"] = "W1111"; | |
| dr["Variables"] = "V1111"; | |
| dr["OrgValue"] = "O1111"; | |
| TFields.Rows.Add( dr ); | |
| dr = a_tbFields.NewRow(); | |
| dr["ID"] = NextPrimKey.ToString(); | |
| dr["Name"] = "N2222"; | |
| dr["Value"] = "V2222"; | |
| dr["State"] = "S2222"; | |
| dr["Message"] = "M2222"; | |
| dr["MetaData"] = "W2222"; | |
| dr["Variables"] = "V2222"; | |
| dr["OrgValue"] = "O2222"; | |
| TFields.Rows.Add( dr ); | |
| dr = a_tbFields.NewRow(); | |
| dr["ID"] = NextPrimKey.ToString(); | |
| dr["Name"] = "N3333"; | |
| dr["Value"] = "V3333"; | |
| dr["State"] = "S3333"; | |
| dr["Message"] = "M3333"; | |
| dr["MetaData"] = "W3333"; | |
| dr["Variables"] = "V3333"; | |
| dr["OrgValue"] = "O3333"; | |
| TFields.Rows.Add( dr ); | |
| } | |
| return a_tbFields; | |
| } | |
| } | |
| private DataTable a_tbFields = null; | |
| #endregion | |
| /// <summary> | |
| /// artifical Primkey for Table | |
| /// </summary> | |
| public int NextPrimKey | |
| { | |
| set { a_oNextPrimKey = value; } | |
| get { return a_oNextPrimKey++; } | |
| } | |
| private int a_oNextPrimKey = 0; | |
| //[TEST] | |
| protected void ButtonCallback_Click( object sender, EventArgs e ) | |
| { | |
| TFields.AcceptChanges(); | |
| RadGridFieldView.Rebind(); //has no effekt | |
| string sValue = TFields.Rows[0]["Value"].ToString(); | |
| if( sValue != "AAAAA" ) | |
| throw new Exception( "Changes on clientside per javascript not processed!" ); | |
| string sValue2 = TFields.Rows[1]["Value"].ToString(); | |
| if( sValue2 != "BBBB" ) | |
| throw new Exception( "Changes on clientside per javascript not processed!" ); | |
| } | |
| //[TEST] | |
| protected void ButtonPostBack_Click( object sender, EventArgs e ) | |
| { | |
| RadGridFieldView.Rebind(); //has no effekt | |
| TFields.AcceptChanges(); | |
| string sValue = TFields.Rows[0]["Value"].ToString(); | |
| if( sValue != "AAAAA" ) | |
| throw new Exception( "Changes on clientside per javascript not processed!" ); | |
| string sValue2 = TFields.Rows[1]["Value"].ToString(); | |
| if( sValue2 != "BBBB" ) | |
| throw new Exception( "Changes on clientside per javascript not processed!" ); | |
| } | |
| } | |
| } | |
Telerik version: 1125.35 (.net 3.5 dll)
Debug set to false on my original project
All tested with IE7
I have taken a lot of time to put this sample together for you guys can see the issues I am having, I hope u guys will do the Same into looking into these
issues and provide me with.
1. Clear answers if something I am doing wrong
2. If an actual bug in Telerik and when it will be fixed
3. If suggestions I make will make it to which release if at all.
LAYOUT ISSUES
-----------------
(Main Page)
1. Extend menu and pin it - scheduler does not resize properly (causing horizontal scrolling).
2. Unpin extended menu after the scheduler is sized properly (by moving the slider or refreshing the inner frame) will cause the scheduler to resize smaller
than the area available.
3. Inside the ContentMaster.master - Gray div being set to 100% causes initial horizontal scrollers, setting it to 99% fixes it but there is a little gap
between the right side of the screen and the div.
4. Most of the provided telerik skins the appointment template renders content to the bottom of the cell and not center vertically. For example sunset skin
is moving the text (subject) and image to the bottom where as vista skin is right.
5. All skins - in the pervious version there use to be a vertical border between resource area and appointments (where it Says Resource 1, Resource 2 this
was removed from the latest version, making it really ugly because at the bottom of the Scheduler there is a double border (see image reference #1)
6. Appointments that are in the future, when bringing them into view (using the slider) the subject does not, however the Template shows that it is an
appointment (image showing), basically drag the slider all the way to the right so that all the Appointments show and the last appointment have no subject or
content.
7. Moving the slider to show more slots, breaks the tooltips added to the information image inside the appointment template,
Load the application, hover over the information image inside the app. template this will work, and then move the slider one spot to show more slots, hover
over the image for info, no tooltip, and bring the slider back to original spot, tooltip works again.
8. I have added the context menu to the scheduler, this works good most of the times, however sometimes the menu shows up but The java’s script event does
not fire (as in all the menu items are enabled), this I can’t reproduce very well because it happens Sometimes, so it’s hard to explain how to reproduce it,
other than run the application for a bit then right click on Appointments, again this happens sometimes and not all the time.
(Reservation Popup)
1. Initial load as u can see is very slow and u can actually see the form without decoration then the decoration kicks in, Performance issues.
2. a) hover over the "Search" collapsable panel (top left), this will slide down the search area. Click the "hide search", this Will hide it perfectly, now
move the mouse search panel again and it does not slide it down, u have to move Ur mouse in and Out twice for this to work, I suspect this is got something
to do with how I am collapsing it and not setting a property Somewhere for the panel to know what state it’s in.
b) This is also the cause for the room’s panel at the top.
3. textboxes/controls inside the slide panels are not getting decorated
4. Controls inside the multipage (click contact info tab) to see that the controls are not decorated
5. Notes tab also has no decorated controls.
Suggestions
==============
1. Realistically when can I expect this? http://www.telerik.com/community/forums/aspnet-ajax/scheduler/getappointmentsinrange-resource-aware.aspx
2. Disallow multiple appointments in same day in timeline view (remove the ability to cause appointment inserts) by removing Slots, I believe this was
suppose to make it to SP1 but didn’t find away to do this.
3. Customizable footer template so I can put stats in, I could do this without the footer but it would be nice if it’s part of the scheduler so the look and
feel is the same
4. Slider added to the timeline view to change the number of slots as I did in my sample, again so that it is with the Control if the user wants it enabled.
5. Ability to remove the delete button from appointments as a setting without the css proposed hacks.
6. Context menu needs a header template (I see in case of the demo u used with the scheduler, as a header u used a disabled Item, it would be nice if we can
make this pretty with a header template).
7. radcalender, radinput,radtextbox, should all respect the form decoration style skins so all controls look alike.
| <telerik:RadDateTimePicker ID="RadDateTimePickerRunning" Width="280px" TimeView-Caption="Время" |
| TimeView-Culture="Russian (Russia)" TimeView-Width="210px" |
| TimeView-TimeFormat="H:mm" Calendar-CultureInfo="Russian (Russia)" |
| runat="server" skin="WebBlue"> |
| <DateInput Width="210px" |
| DateFormat="dd MM yyyy H:mm" |
| DisplayDateFormat="dd MM yyyy H:mm" > |
| </DateInput> |
| <Calendar CultureInfo="Russian (Russia)" |
| CellDayFormat="[ %d ]" |
| DayCellToolTipFormat="d MMM, yyyy"> |
| </Calendar> |
| <TimeView ID="TimeView1" runat="server"> |
| <HeaderTemplate> |
| Время |
| </HeaderTemplate> |
| </TimeView> |
| </telerik:RadDateTimePicker> |

And after that i want the text to get from RadtextBox when one imagebutton is clicked out of two and some hiden columns values of that specific row to call my webservice, but all this at the client end. Please help me.
Can you provide me some code for it? Please....
Here`s my server side code for that above mentioned processes:
protected
void RadGrid_NoteBook_ItemCommand(object source, GridCommandEventArgs e)
{
if (e.CommandName == "Note") // when imageButton 'Note' is clicked
{
RadTextBox textBox = new RadTextBox();
foreach (GridItem item in RadGrid_NoteBook.MasterTableView.Items)
{
if (item.Edit)
{
GridEditFormItem editItem = (GridEditFormItem)RadGrid_NoteBook.MasterTableView.GetItems(GridItemType.EditFormItem)[item.ItemIndex];
textBox = (
RadTextBox)editItem.FindControl("NoteBook_NoteBackTextBox");
editItem.Edit =
false;
break;
}
}
GridDataItem gitem = (GridDataItem)e.Item;
Hashtable table = new Hashtable();
gitem.ExtractValues(table);
string temp_UserId = table["SenderUserId"].ToString(); // my hidden cloumn 'SenderUserId' value
Guid UserId = new Guid(temp_UserId);
string Username = table["SenderUsername"].ToString();
Guid SenderUserId = new Guid(Session["UserId"].ToString());
DataSetTableAdapters.
Queries query = new DataSetTableAdapters.Queries();
query.InsertNotes(Session[
"Username"].ToString(), SenderUserId, textBox.Text, DateTime.Now); // my query fo insertion in database
int NoteId = (int)query.GetNoteIdFromSenderUsernameAndSenderUserId(Session["Username"].ToString(), SenderUserId, textBox.Text, DateTime.Now);
query.InsertIntoUser_NoteBookFromNoteId(UserId, NoteId);
}
}
