iSeller Commerce
iSeller POS Retail
iSeller POS F&B
iSeller POS Express
Crosslight
WebUI
ClientUI
What's New
Download Trial
Web Solution
Mobile Solution
Enterprise Solution
Custom Development
Blog
Community
Latest Development Blogs
ForumPostTopic
Browse By Tag
A user has created a new thread, Day header color changes on mouse over, in which he show a flaw with the provided snippet on Week view and Month view.
The thread also has a modified snippet in order to overcome the flaw.
I believe this is the previous issue you mention in your post, Modify scheduler Day Header color
Further test indicate that in Week view and Month view, since the header will have dynamic style, the custom style will be overridden by the scheduler header style. For such scenario, you will need to create a HTML element, a DIV, in the header and move all the child node of the header to the newly created DIV. The style will be appended to this newly created DIV. Here is the modified snippet:
<style type="text/css"> .customHead { background-image: none; background-color: Black; color: White; }</style><script type="text/javascript" language="javascript"> function WebScheduler1_OnAfterRenderView(controlId, viewMode) { var sched = ISGetObject(controlId); var headerElem = null; var type = ""; //Setting all date 1 to have black background color with white text switch (viewMode) { case "Day": headerElem = sched.GetDayDayHeader().getElementsByTagName('td'); type = 'DayHeader;'; break; case "Week": headerElem = sched.GetWeekDayHeader().getElementsByTagName('td'); type = 'DayHeader;'; break; case "Month": headerElem = sched.GetSchedulerTableFrame().getElementsByTagName('td'); type = 'MonthInboundDateHeader;MonthOutboundDateHeader;'; break; case "Quarter": headerElem = sched.GetSchedulerTableFrame().getElementsByTagName('td'); type = 'YearDayOfWeek;'; break; case "Year": headerElem = sched.GetSchedulerTableFrame().getElementsByTagName('td'); type = 'YearDayOfWeek;'; break; } if (headerElem != null) { for (var i = 0; i < headerElem.length; i++) { if (type.indexOf(headerElem[i].getAttribute('type') + ";") != -1 && headerElem[i].getAttribute('d') == '1') { var innerContent = headerElem[i].innerHTML; var childs = headerElem[i].childNodes; var childCount = childs.length; var loop = 0; var newdiv = document.createElement('div'); newdiv.className = "customHead"; newdiv.style.height = headerElem[i].clientHeight + "px"; newdiv.style.lineHeight = headerElem[i].clientHeight + "px"; while (loop < childCount) { newdiv.appendChild(childs[0]); loop++; } headerElem[i].appendChild(newdiv); } } } }</script>
We have explained in detail regarding this functionality in the article titled "Data editing with new Batch Update mode" on WebGrid documentation, some sub section which is related to the scenario you are trying to achieve is "Understanding Batch Update Processes" and "Server-side Programmability".
A sample demonstrating CustomObject update has also been shown in our sample, BatchUpdate_CustomObjectUpdate.aspx
In my test using the latest build for WebGrid 7 and WebUI Framework 3, build 402 and build 752 respectively, I could successfully refresh the grid during flypostback.
In my scenario, I use a WebButton in order to trigger a flypostback request and during the click event handler, I will need to invoke the RenderControl function to refresh the WebGrid and during FlyPostBackRequest the initialize data source logic will be executed. Here is the snippet:
protected void WebButton1_Clicked(object sender, ISNet.WebUI.WebDesktop.WebButtonClickedEventArgs e){ WebButton1.ClientAction.RenderControl(WebGrid1); }
Based on the feedback of the developer, the issue occurs because there is some required css style in order to render the all day event as it is display by default. The required style is Font-Size="1px" and VerticalAlign="Top". Here is the snippet for the modified disabled all day style:
<DisabledAllDayEventAreaStyle BackColor="Red" VerticalAlign="Top" Font-Size="1px"></DisabledAllDayEventAreaStyle>
In my test, I set a static height for each row (24px) since all the row is a single line row. If you are using multi row cell or other scenario in which the height for each row could be different, the workaround would be to iterate all the row and sum all the height, as you have done using jQuery.
In my test a dynamically created panel that I created during PageLoad server side event handler could also be used in order to refresh the display.
However, a dynamically created panel during the execution of WebFlyPostBackMethod will not work. In that case, the parameter for the RenderControl would be the control which you attached the panel to, not the ASP Panel.
Unfortunately, our WebFlyPostBackManager have not support render control using WebUserControl. However, you could contain the WebUserControl in an ASP Panel and use the Panel object as the RenderControl parameter to refresh all the control in WebUserControl.
Another suggestion, if you do not prefer to pass the WebFlyPostBackManager you could manually select the modified control in the WebUserControl and invoke the RenderControl on the selected modified control.
As far as I know, there is no function / method to set a text in the row header in WebGrid. However, we could use a workaround to achieve the screenshot, by simulating a cell with a similar style to the row header and disable the row header in WebGrid. During RowInitialize server side event you will need to set the value of this cell.
Here is the snippet:
The new cell with row header style:
<ISWebGrid:WebGridColumn Width="20px" EditType="NoEdit" Name="idxBox" Caption=" "> <CellStyle BackColor="#e4ecf7" CustomRules="text-align: center;"></CellStyle></ISWebGrid:WebGridColumn>
RowInitialize event handler snippet:
protected void wgTest_InitializeRow(object sender, RowEventArgs e){ if (e.Row.Type == RowType.Record) { e.Row.Cells.GetNamedItem("idxBox").Text = (e.Row.Position + 1).ToString(); e.Row.Cells.GetNamedItem("idxBox").Value = (e.Row.Position + 1).ToString(); }}
In order to remove the row header you will need to set RowHeaders="No" under LayoutSettings
or
Choose this if you're already a member of Intersoft Community Forum. You can link your OpenID account to your existing Intersoft Social ID.
Choose this if you don't have an Intersoft account yet. Your authenticated OpenID will be automatically linked to your new Intersoft account.
Enter your Wordpress Blogname