Hello all, specially Vlad ^_^
I have an issue for you. I encouter a NullPointerException with my grid.
As you will see in provided code, the grid is pretty simple, with EditMode set to /InPlace/, and it allows column sizing ...
I apologize in advance if this issue has already been raised, but I haven't seen related stuff in the existing threads ... except perhaps an old thread concerning an old version of the control with different behavior [ Bizarre Grid Behavior ]
In my case, the Edit/Update process works well, and the sizing process seems to do what it supposed to do as well .. with a little bemol here, but that's not the point of this topic ... The issue appears when you try to mix both, I mean click on Edit and while editing you resize any column .. then after when you try to validate your changes by clicking the Update link .. the exception is raised.
Same result in the opposite way, if you resize a column and after that click on Edit it breaks ... That's seems pretty ugly, because I cannot mix resize and edit ... :-(
At first it was javascript exception : Sys.WebForms.PageRequestManagerServerErrorException : Object reference not set to an instance of an object.
Much interesting call stack with Ajax disabled :
Exception Details: System.NullReferenceException: Object reference not set to an instance of an object.
Stack Trace:
|
| <telerik:RadGrid ID="RadGridCommunication" runat="server" |
| EnableViewState="False" |
| AutoGenerateColumns="False" |
| OnNeedDataSource="RadGridCommunication_NeedDataSource" |
| GridLines="None" |
| Skin="Office2007" |
| AllowPaging="True" |
| PageSize="3" |
| ShowStatusBar = "true" |
| > |
| <MasterTableView |
| CommandItemDisplay= "Top" |
| EditMode="InPlace" |
| > |
| <Columns> |
| <telerik:GridEditCommandColumn UniqueName="EditCommandColumn" /> |
| <telerik:GridBoundColumn DataField="Name" HeaderText="Name" DataFormatString="<nobr>{0}</nobr>" /> |
| <telerik:GridBoundColumn DataField="Age" HeaderText="Age" DataFormatString="<nobr>{0}</nobr>" /> |
| <telerik:GridBoundColumn DataField="Email" HeaderText="Email" DataFormatString="<nobr>{0}</nobr>"/> |
| <telerik:GridBoundColumn DataField="Phone" HeaderText="Phone" DataFormatString="<nobr>{0}</nobr>"/> |
| </Columns> |
| <CommandItemStyle CssClass="gridCommandBar" /> |
| <CommandItemTemplate> |
| <div style="float: left"> |
| <asp:Label ID="Label1" CssClass="blockTitleForm" runat="server" EnableViewState="False" >Communication Medium</asp:Label> |
| </div> |
| <div style="float: right"> |
| <asp:LinkButton Style="vertical-align: bottom" ID="btnEditSelected" runat="server" EnableViewState="False" |
| CommandName="EditSelected" Visible='<%# RadGridCommunication.EditIndexes.Count == 0 %>' |
| > |
| <img style="border:0px" alt="" src="../im/btnGoToPage_01.png" / title="Edit selected item" EnableViewState="False" > |
| </asp:LinkButton> |
| </div> |
| </CommandItemTemplate> |
| </MasterTableView> |
| <ClientSettings AllowColumnsReorder="true" > |
| <ClientEvents OnCommand="RadGridCommunication_Command" /> |
| <Resizing |
| AllowColumnResize="True" |
| AllowRowResize="false" |
| ResizeGridOnColumnResize="false" |
| ClipCellContentOnResize="true" |
| EnableRealTimeResize="false" /> |
| </ClientSettings> |
| <StatusBarSettings LoadingText="Loading ..." ReadyText ="Ready"/> |
| </telerik:RadGrid> |
| [WebMethod] |
| public static IEnumerable<NWA.POC.Models.Contact> GetData() |
| { |
| var path = HttpContext.Current.Server.MapPath(@"Data\contacts.xml"); |
| var xml = System.Xml.Linq.XDocument.Load(path) |
| .Descendants("Contact"); |
| var contacts = from contact in xml |
| select new NWA.POC.Models.Contact |
| { |
| ID = Convert.ToInt32(contact.Element("ID").Value), |
| Name = contact.Element("Name").Value, |
| Age = Convert.ToInt32(contact.Element("Age").Value), |
| Sex = contact.Element("Sex").Value, |
| Email = contact.Element("Email").Value, |
| Phone = contact.Element("Phone").Value |
| }; |
| return contacts; |
| } |

I am tring to get the value of the DataValueID that I used to build the tree when nodeselcted is fired. I get the text back but cant seem to get the orignal ID back. Any Ideas?
Code Snippet.
protected override void OnInit(EventArgs e)
{
RadTreeView1.Nodes.Clear();
DataAccess.DA dt = new DA("Connection string");
DB.m_da = dt;
try
{
DataSet dsp = new DataSet();
DB.m_da.SetRead("SELECT 'All Providers' AS [Name], '0' AS [ID], null as tree union SELECT [FName] + ' ' + [LName] AS [Name], [ID],0 as [Tree] FROM Provider WHERE [Inactive] = 0 ORDER BY 1", 1);
DB.m_da.Run(ref dsp);
RadTreeView1.DataSource = dsp;
RadTreeView1.DataFieldID = "ID";
RadTreeView1.DataTextField = "Name";
RadTreeView1.DataFieldParentID = "Tree";
RadTreeView1.DataBind();
RadTreeView1.ExpandAllNodes();
RadTreeView1.MultipleSelect = true;
RadTreeView1.CheckBoxes = true;
}
catch (Exception ex)
{
string s = ex.Message;
}
}
protected void Page_Load(object sender, EventArgs e)
{
}
protected void Button1_Click(object sender, EventArgs e)
{
Label1.Text = "Providers Saved";
System.Collections.Generic.IList<RadTreeNode> providercheck = RadTreeView1.CheckedNodes;
}
protected void RadTreeView1_NodeCheck(object sender, RadTreeNodeEventArgs e)
{
string check = e.Node.CheckState.ToString();
//string provider = e.Node
System.Collections.Generic.IList<RadTreeNode> providercheck = RadTreeView1.CheckedNodes;
// DataSet dsp = new DataSet();
// DB.m_da.SetRead("", 1);
// DB.m_da.Run(ref dsp);
}
}
Hi,
I did the below code to get the return value "true" then submit the page again.
what happens is that before getting the value page submit.
first I want to know how to get the return true or false from radconfirm and then how to do submit then sequentially.
function
confirms(arg)
{
var bSave=radconfirm(arg,confirmCallBackFn,300,200,null,'Want to Save');
if (bSave)
{
alert(
'hello');
document.getElementById(
"hidServer").value=1;
document.getElementById(
"form1").submit();
}
else
{
document.getElementById(
"hidServer").value=0;
}
}
function
confirmCallBackFn(arg)
{
alert(arg);
if
(arg == true)
{
document.getElementById(
"form1").submit();
var
oManager = GetRadWindowManager();
oManager.Close();
}
else
{
alert(
'not Closed');
}
}
thanks,
Puru
MonthView-VisibleAppointmentsPerDay
="3"
Is there any way way to do something like this in Week View also.
Thanks in Advance..
Thanks and Regards
Archan