Wednesday, May 12, 2010Implementing selected Grid rows in Gantt_ASP
To get the selected, yellow, row to function when pressing the Select link in the cell read on… 1: /// Add a Select button in the grid 2: Gantt_ASP1.Gantt.Grid.Columns.AddNew(PlexityHide.GTP.CellType.SingleText); 3: Gantt_ASP1.Gantt.Grid.Columns[2].DataSourceColumn = ""; 4: Gantt_ASP1.OnPostBackEvent += new EventHandler(Gantt_ASP1_OnPostBackEvent); 5: CellLayout cl = new CellLayout(); 6: cl.BackgroundColor = Color.Yellow; 7: cl.BackgroundUse = true; 8: cl.Name = "SelectedRow"; 9: Gantt_ASP1.Gantt.Grid.CellLayouts.Add(cl); The code above is added to the page load; it adds a column, it adds an eventhandler for OnPostBack, and it adds cellLayout that we will use to highlight the selected row. I also implement the OnCellContentTuning event to add a link in the cell that is in column 2 1: void Gantt_ASP1_OnCellContentTuning(Gantt_ASP aGantt, CellContentTuningArgs e) 2: { 3: if (e.Cell.Column.Index == 2) 4: { 5: if (e.Cell.GridNode != null) 6: { 7: string postbackref = "Select:" + Gantt_ASP1.GridNodeKey(e.Cell.GridNode); 8: e.Content = "<a href=\"javascript:" + Page.ClientScript.GetPostBackEventReference(aGantt, postbackref) + "\">Select</a>"; 9: } 10: } 11: } The implementation of the OnPostBack: 1: void Gantt_ASP1_OnPostBackEvent(object sender, EventArgs e) 2: { 3: string[] parts = Page.Request.Params[2].Split(':'); 4: if (parts.Length > 1) 5: { 6: if (parts[0] == "Select") 7: { 8: GridNode gn = Gantt_ASP1.GridNodeFromKey(parts[1]); 9: if (gn != null) 10: { 11: Gantt_ASP1.Gantt.Grid.FocusedCell = gn.GetCell(0); 12: this.ViewState["SelectedNode"] = parts[1]; 13: } 14: } 15: } 16: } In the code above I set the ViewState variable “SelectedNode” to the key of the GridNode And finally I implement the event OnClientSideChangesApplied to apply the CellLayout to the row that is defined by the ViewState variable: 1: protected void Gantt_ASP1_OnClientSideChangesApplied(object sender, EventArgs e) 2: { 3: string s = this.ViewState["SelectedNode"] as string; 4: if (s != null) 5: { 6: GridNode gn = Gantt_ASP1.GridNodeFromKey(s); 7: if (gn != null) 8: { 9: gn.SetCellLayoutOnAll(Gantt_ASP1.Gantt.Grid.CellLayouts.GetFromName("SelectedRow")); 10: } 11: } 12: 13: } Done.
Comments:
This is exactly what I wanted to read, hope in future you will continue sharing such an excellent article Best JAVA Training in Chennai JAVA Training
This could be one of the most useful blogs I have ever come across on this technology. I am a newbie to this technology. Great work admin.
Best Hadoop Training in Chennai Best hadoop training institute in chennai Big Data Hadoop Training in Chennai
IEEE Final Year Project centers make amazing deep learning final year projects ideas for final year students Final Year Projects for CSE to training and develop their deep learning experience and talents.
IEEE Final Year projects Project Centers in India are consistently sought after. Final Year Students Projects take a shot at them to improve their aptitudes, while specialists like the enjoyment in interfering with innovation. corporate training in chennai corporate training in chennai corporate training companies in india corporate training companies in india corporate training companies in chennai corporate training companies in chennai I have read your blog its very attractive and impressive. I like it your blog. Digital Marketing Company in Chennai
aşk kitapları
youtube abone satın al cami avizesi cami avizeleri avize cami no deposit bonus forex 2021 takipçi satın al takipçi satın al takipçi satın al takipcialdim.com/tiktok-takipci-satin-al/ instagram beğeni satın al instagram beğeni satın al btcturk tiktok izlenme satın al sms onay youtube izlenme satın al no deposit bonus forex 2021 tiktok jeton hilesi tiktok beğeni satın al binance takipçi satın al uc satın al sms onay sms onay tiktok takipçi satın al tiktok beğeni satın al twitter takipçi satın al trend topic satın al youtube abone satın al instagram beğeni satın al tiktok beğeni satın al twitter takipçi satın al trend topic satın al youtube abone satın al takipcialdim.com/instagram-begeni-satin-al/ perde modelleri instagram takipçi satın al instagram takipçi satın al takipçi satın al instagram takipçi satın al betboo marsbahis sultanbet
beğeni satın al
instagram takipçi satın al ucuz takipçi takipçi satın al https://takipcikenti.com https://ucsatinal.org instagram takipçi satın al https://perdemodelleri.org https://yazanadam.com instagram takipçi satın al balon perdeler petek üstü perde mutfak tül modelleri kısa perde modelleri fon perde modelleri tül perde modelleri https://atakanmedya.com https://fatihmedya.com https://smmpaketleri.com https://takipcialdim.com https://yazanadam.com yasaklı sitelere giriş aşk kitapları yabancı şarkılar sigorta sorgula https://cozumlec.com word indir ücretsiz tiktok jeton hilesi rastgele görüntülü sohbet erkek spor ayakkabı fitness moves gym workouts https://marsbahiscasino.org http://4mcafee.com http://paydayloansonlineare.com
I truly appreciate just perusing the entirety of your weblogs. Just needed to educate you that you have individuals like me who value your work. Unquestionably an extraordinary post. Caps off to you! The data that you have given is exceptionally useful.data science training in chennai
instagram beğeni satın al
yurtdışı kargo seo fiyatları saç ekimi dedektör fantazi iç giyim sosyal medya yönetimi farmasi üyelik mobil ödeme bozdurma
Smm Panel
smm panel iş ilanları İnstagram Takipçi Satın Al HIRDAVATÇI BURADA beyazesyateknikservisi.com.tr servis tiktok jeton hilesi
bostansepeti.com
site kurma ürünler vezirsosyalmedya.com postegro sosyal medya yönetimi surucukursuburada.com Subscribe to Post Comments [Atom] << Home Subscribe to Posts [Atom] |
|

Post a Comment