SlideShare a Scribd company logo
Master –Slave in GridView
Let ussee howto create a master-slave gridviewsinVisual WebDeveloper.
Imagine,yourbackendtablescontainthe followingdata:
Table 1:
Employee_CD Employee_Name
10001 DharmarajuBK
10002 SanjanaD
10003 Kiran
10004 Muni
10005 Narayana
10006 ABC
10007 xyz
10008 tttt
Table 2:
Employee_CD Date_of_Contribution Amount
10003 10-02-2021 1000
10003 01-03-2021 500
10003 01-04-2021 5000
10001 10-02-2021 5000
10001 01-04-2021 3000
10001 01-05-2021 1500
10001 01-08-2021 500
10001 01-05-2021 500
10002 01-01-2021 10000
Now,letussee howto displaythe above intwo GridViewsinMaster-Slave relationshipasshown
belowFig1andFig2:
Fig – 1
Fig - 2
1. Drag and Drop a GridViewintothe webpage.
2. Attach Back-enddatabase table whichyouwantto treat as Master Table.
3. Clickon the Gridview.Inthe Propertieswindow,find Parameterbyname – “Data Key
Names”.Clickonthisrow. You will see the listof columnsinthe back-endtable appears ina
pop-upwindow. Clickonthe KeyField/column name andpresson > mark. ThenpressOK
button. See the belowpictures.
4. From the GridViewTasks,choose ‘EnableSelection’Option.See below picture
5. You can alsochoose BackgroundColourfor a SelectedRow of thisGridview. Clickonthe
Gridview.FromGridViewproperties,choose SelectedRowStyle BackColoroption.Choose
a colour fromthe ColourPallette
The above stepssetsup the GridViewforthe MasterTable.
Setting Up of GridView for the Slave or Item or Child Data
Now,adda secondGridView todisplay Slave orItemorChildData. Place thissecondGridViewjust
belowthe firstone. Setitspositionto‘Relative’ byusingbelow steps:
1. Drag and Drop secondGridViewintothe webpage. Setsitspositionas‘Relative’byselecting
optionsFormat  SetPosition  Relative.Positionitjustbelow the firstGridView.
Relative position will helpyoutoplace the secondGridview justbelow the firstGridview.
Also,if the firstGridViewgrowswithmore rows(records),itautomaticallypushesthe
secondGridviewdown,avoidingoverlappingof twoGridViews.
2. You needtoattach slave / childtable fromback-enddatabase.Inthe Configure Data Source
screen,selectsuitable back-endtable. Selectcolumnsyouwanttodisplay.Afterthis,clickon
Where Button (See the belowFigure)
3. In the column,choose Key field(ie.The columnwhichiscommonbetweentwotables –
Master and Slave);SetOperatorValue to=; SelectSource = Control;Control ID= Gridview1.
You can see where clause expressionappearsautomaticallyinthe ‘Where Clause’ window
(See the belowFigure). PressOKButton.
4. ClickNext FinishButtons
5. Run thispage ina Browser.Clickon‘SELECT’ Linkinthe FirstGridview togetthe displayof
relatedrow(s) inthe SecondGridView. If there are nomatchingrowsavailable inthe
Child/Slave table forthe selectedvalue,thentherewillbe nodisplay inthe second
GridView.

More Related Content

More from Dharma Raju

Change row colour based on some condition
Change row colour based on some conditionChange row colour based on some condition
Change row colour based on some condition
Dharma Raju
 
Popup confirmation for Delete Button in GridView
Popup confirmation for Delete Button in GridView Popup confirmation for Delete Button in GridView
Popup confirmation for Delete Button in GridView
Dharma Raju
 
How to add sorting and pagers to grid view
How to add sorting and pagers to grid viewHow to add sorting and pagers to grid view
How to add sorting and pagers to grid view
Dharma Raju
 
How to add sql server table into dot net web page (Gridview)
How to add sql server table into dot net web page (Gridview)How to add sql server table into dot net web page (Gridview)
How to add sql server table into dot net web page (Gridview)
Dharma Raju
 
Providing sl no in Gridview in Dot Net
Providing sl no in Gridview in Dot NetProviding sl no in Gridview in Dot Net
Providing sl no in Gridview in Dot Net
Dharma Raju
 
Windows Communication Foundation (WCF) programming using Visual Studio
Windows Communication Foundation (WCF) programming using Visual StudioWindows Communication Foundation (WCF) programming using Visual Studio
Windows Communication Foundation (WCF) programming using Visual Studio
Dharma Raju
 
Web services in asp.net
Web services in asp.netWeb services in asp.net
Web services in asp.net
Dharma Raju
 
Internal tables in sap
Internal tables in sapInternal tables in sap
Internal tables in sap
Dharma Raju
 
Govina haadu
Govina haaduGovina haadu
Govina haadu
Dharma Raju
 
Coffee
CoffeeCoffee
Coffee
Dharma Raju
 

More from Dharma Raju (10)

Change row colour based on some condition
Change row colour based on some conditionChange row colour based on some condition
Change row colour based on some condition
 
Popup confirmation for Delete Button in GridView
Popup confirmation for Delete Button in GridView Popup confirmation for Delete Button in GridView
Popup confirmation for Delete Button in GridView
 
How to add sorting and pagers to grid view
How to add sorting and pagers to grid viewHow to add sorting and pagers to grid view
How to add sorting and pagers to grid view
 
How to add sql server table into dot net web page (Gridview)
How to add sql server table into dot net web page (Gridview)How to add sql server table into dot net web page (Gridview)
How to add sql server table into dot net web page (Gridview)
 
Providing sl no in Gridview in Dot Net
Providing sl no in Gridview in Dot NetProviding sl no in Gridview in Dot Net
Providing sl no in Gridview in Dot Net
 
Windows Communication Foundation (WCF) programming using Visual Studio
Windows Communication Foundation (WCF) programming using Visual StudioWindows Communication Foundation (WCF) programming using Visual Studio
Windows Communication Foundation (WCF) programming using Visual Studio
 
Web services in asp.net
Web services in asp.netWeb services in asp.net
Web services in asp.net
 
Internal tables in sap
Internal tables in sapInternal tables in sap
Internal tables in sap
 
Govina haadu
Govina haaduGovina haadu
Govina haadu
 
Coffee
CoffeeCoffee
Coffee
 

Recently uploaded

快速办理(新加坡SMU毕业证书)新加坡管理大学毕业证文凭证书一模一样
快速办理(新加坡SMU毕业证书)新加坡管理大学毕业证文凭证书一模一样快速办理(新加坡SMU毕业证书)新加坡管理大学毕业证文凭证书一模一样
快速办理(新加坡SMU毕业证书)新加坡管理大学毕业证文凭证书一模一样
3a0sd7z3
 
办理新西兰奥克兰大学毕业证学位证书范本原版一模一样
办理新西兰奥克兰大学毕业证学位证书范本原版一模一样办理新西兰奥克兰大学毕业证学位证书范本原版一模一样
办理新西兰奥克兰大学毕业证学位证书范本原版一模一样
xjq03c34
 
Bengaluru Dreamin' 24 - Personal Branding
Bengaluru Dreamin' 24 - Personal BrandingBengaluru Dreamin' 24 - Personal Branding
Bengaluru Dreamin' 24 - Personal Branding
Tarandeep Singh
 
成绩单ps(UST毕业证)圣托马斯大学毕业证成绩单快速办理
成绩单ps(UST毕业证)圣托马斯大学毕业证成绩单快速办理成绩单ps(UST毕业证)圣托马斯大学毕业证成绩单快速办理
成绩单ps(UST毕业证)圣托马斯大学毕业证成绩单快速办理
ysasp1
 
快速办理(Vic毕业证书)惠灵顿维多利亚大学毕业证完成信一模一样
快速办理(Vic毕业证书)惠灵顿维多利亚大学毕业证完成信一模一样快速办理(Vic毕业证书)惠灵顿维多利亚大学毕业证完成信一模一样
快速办理(Vic毕业证书)惠灵顿维多利亚大学毕业证完成信一模一样
3a0sd7z3
 
Discover the benefits of outsourcing SEO to India
Discover the benefits of outsourcing SEO to IndiaDiscover the benefits of outsourcing SEO to India
Discover the benefits of outsourcing SEO to India
davidjhones387
 
HijackLoader Evolution: Interactive Process Hollowing
HijackLoader Evolution: Interactive Process HollowingHijackLoader Evolution: Interactive Process Hollowing
HijackLoader Evolution: Interactive Process Hollowing
Donato Onofri
 
办理毕业证(NYU毕业证)纽约大学毕业证成绩单官方原版办理
办理毕业证(NYU毕业证)纽约大学毕业证成绩单官方原版办理办理毕业证(NYU毕业证)纽约大学毕业证成绩单官方原版办理
办理毕业证(NYU毕业证)纽约大学毕业证成绩单官方原版办理
uehowe
 
存档可查的(USC毕业证)南加利福尼亚大学毕业证成绩单制做办理
存档可查的(USC毕业证)南加利福尼亚大学毕业证成绩单制做办理存档可查的(USC毕业证)南加利福尼亚大学毕业证成绩单制做办理
存档可查的(USC毕业证)南加利福尼亚大学毕业证成绩单制做办理
fovkoyb
 
manuaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaal
manuaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaalmanuaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaal
manuaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaal
wolfsoftcompanyco
 
留学挂科(UofM毕业证)明尼苏达大学毕业证成绩单复刻办理
留学挂科(UofM毕业证)明尼苏达大学毕业证成绩单复刻办理留学挂科(UofM毕业证)明尼苏达大学毕业证成绩单复刻办理
留学挂科(UofM毕业证)明尼苏达大学毕业证成绩单复刻办理
uehowe
 
办理毕业证(UPenn毕业证)宾夕法尼亚大学毕业证成绩单快速办理
办理毕业证(UPenn毕业证)宾夕法尼亚大学毕业证成绩单快速办理办理毕业证(UPenn毕业证)宾夕法尼亚大学毕业证成绩单快速办理
办理毕业证(UPenn毕业证)宾夕法尼亚大学毕业证成绩单快速办理
uehowe
 
Ready to Unlock the Power of Blockchain!
Ready to Unlock the Power of Blockchain!Ready to Unlock the Power of Blockchain!
Ready to Unlock the Power of Blockchain!
Toptal Tech
 
Should Repositories Participate in the Fediverse?
Should Repositories Participate in the Fediverse?Should Repositories Participate in the Fediverse?
Should Repositories Participate in the Fediverse?
Paul Walk
 
一比一原版(USYD毕业证)悉尼大学毕业证如何办理
一比一原版(USYD毕业证)悉尼大学毕业证如何办理一比一原版(USYD毕业证)悉尼大学毕业证如何办理
一比一原版(USYD毕业证)悉尼大学毕业证如何办理
k4ncd0z
 
怎么办理(umiami毕业证书)美国迈阿密大学毕业证文凭证书实拍图原版一模一样
怎么办理(umiami毕业证书)美国迈阿密大学毕业证文凭证书实拍图原版一模一样怎么办理(umiami毕业证书)美国迈阿密大学毕业证文凭证书实拍图原版一模一样
怎么办理(umiami毕业证书)美国迈阿密大学毕业证文凭证书实拍图原版一模一样
rtunex8r
 

Recently uploaded (16)

快速办理(新加坡SMU毕业证书)新加坡管理大学毕业证文凭证书一模一样
快速办理(新加坡SMU毕业证书)新加坡管理大学毕业证文凭证书一模一样快速办理(新加坡SMU毕业证书)新加坡管理大学毕业证文凭证书一模一样
快速办理(新加坡SMU毕业证书)新加坡管理大学毕业证文凭证书一模一样
 
办理新西兰奥克兰大学毕业证学位证书范本原版一模一样
办理新西兰奥克兰大学毕业证学位证书范本原版一模一样办理新西兰奥克兰大学毕业证学位证书范本原版一模一样
办理新西兰奥克兰大学毕业证学位证书范本原版一模一样
 
Bengaluru Dreamin' 24 - Personal Branding
Bengaluru Dreamin' 24 - Personal BrandingBengaluru Dreamin' 24 - Personal Branding
Bengaluru Dreamin' 24 - Personal Branding
 
成绩单ps(UST毕业证)圣托马斯大学毕业证成绩单快速办理
成绩单ps(UST毕业证)圣托马斯大学毕业证成绩单快速办理成绩单ps(UST毕业证)圣托马斯大学毕业证成绩单快速办理
成绩单ps(UST毕业证)圣托马斯大学毕业证成绩单快速办理
 
快速办理(Vic毕业证书)惠灵顿维多利亚大学毕业证完成信一模一样
快速办理(Vic毕业证书)惠灵顿维多利亚大学毕业证完成信一模一样快速办理(Vic毕业证书)惠灵顿维多利亚大学毕业证完成信一模一样
快速办理(Vic毕业证书)惠灵顿维多利亚大学毕业证完成信一模一样
 
Discover the benefits of outsourcing SEO to India
Discover the benefits of outsourcing SEO to IndiaDiscover the benefits of outsourcing SEO to India
Discover the benefits of outsourcing SEO to India
 
HijackLoader Evolution: Interactive Process Hollowing
HijackLoader Evolution: Interactive Process HollowingHijackLoader Evolution: Interactive Process Hollowing
HijackLoader Evolution: Interactive Process Hollowing
 
办理毕业证(NYU毕业证)纽约大学毕业证成绩单官方原版办理
办理毕业证(NYU毕业证)纽约大学毕业证成绩单官方原版办理办理毕业证(NYU毕业证)纽约大学毕业证成绩单官方原版办理
办理毕业证(NYU毕业证)纽约大学毕业证成绩单官方原版办理
 
存档可查的(USC毕业证)南加利福尼亚大学毕业证成绩单制做办理
存档可查的(USC毕业证)南加利福尼亚大学毕业证成绩单制做办理存档可查的(USC毕业证)南加利福尼亚大学毕业证成绩单制做办理
存档可查的(USC毕业证)南加利福尼亚大学毕业证成绩单制做办理
 
manuaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaal
manuaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaalmanuaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaal
manuaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaal
 
留学挂科(UofM毕业证)明尼苏达大学毕业证成绩单复刻办理
留学挂科(UofM毕业证)明尼苏达大学毕业证成绩单复刻办理留学挂科(UofM毕业证)明尼苏达大学毕业证成绩单复刻办理
留学挂科(UofM毕业证)明尼苏达大学毕业证成绩单复刻办理
 
办理毕业证(UPenn毕业证)宾夕法尼亚大学毕业证成绩单快速办理
办理毕业证(UPenn毕业证)宾夕法尼亚大学毕业证成绩单快速办理办理毕业证(UPenn毕业证)宾夕法尼亚大学毕业证成绩单快速办理
办理毕业证(UPenn毕业证)宾夕法尼亚大学毕业证成绩单快速办理
 
Ready to Unlock the Power of Blockchain!
Ready to Unlock the Power of Blockchain!Ready to Unlock the Power of Blockchain!
Ready to Unlock the Power of Blockchain!
 
Should Repositories Participate in the Fediverse?
Should Repositories Participate in the Fediverse?Should Repositories Participate in the Fediverse?
Should Repositories Participate in the Fediverse?
 
一比一原版(USYD毕业证)悉尼大学毕业证如何办理
一比一原版(USYD毕业证)悉尼大学毕业证如何办理一比一原版(USYD毕业证)悉尼大学毕业证如何办理
一比一原版(USYD毕业证)悉尼大学毕业证如何办理
 
怎么办理(umiami毕业证书)美国迈阿密大学毕业证文凭证书实拍图原版一模一样
怎么办理(umiami毕业证书)美国迈阿密大学毕业证文凭证书实拍图原版一模一样怎么办理(umiami毕业证书)美国迈阿密大学毕业证文凭证书实拍图原版一模一样
怎么办理(umiami毕业证书)美国迈阿密大学毕业证文凭证书实拍图原版一模一样
 

Master slave control in gridview

  • 1. Master –Slave in GridView Let ussee howto create a master-slave gridviewsinVisual WebDeveloper. Imagine,yourbackendtablescontainthe followingdata: Table 1: Employee_CD Employee_Name 10001 DharmarajuBK 10002 SanjanaD 10003 Kiran 10004 Muni 10005 Narayana 10006 ABC 10007 xyz 10008 tttt Table 2: Employee_CD Date_of_Contribution Amount 10003 10-02-2021 1000 10003 01-03-2021 500 10003 01-04-2021 5000 10001 10-02-2021 5000 10001 01-04-2021 3000 10001 01-05-2021 1500 10001 01-08-2021 500 10001 01-05-2021 500 10002 01-01-2021 10000 Now,letussee howto displaythe above intwo GridViewsinMaster-Slave relationshipasshown belowFig1andFig2: Fig – 1
  • 2. Fig - 2 1. Drag and Drop a GridViewintothe webpage. 2. Attach Back-enddatabase table whichyouwantto treat as Master Table. 3. Clickon the Gridview.Inthe Propertieswindow,find Parameterbyname – “Data Key Names”.Clickonthisrow. You will see the listof columnsinthe back-endtable appears ina pop-upwindow. Clickonthe KeyField/column name andpresson > mark. ThenpressOK button. See the belowpictures.
  • 3. 4. From the GridViewTasks,choose ‘EnableSelection’Option.See below picture 5. You can alsochoose BackgroundColourfor a SelectedRow of thisGridview. Clickonthe Gridview.FromGridViewproperties,choose SelectedRowStyle BackColoroption.Choose a colour fromthe ColourPallette The above stepssetsup the GridViewforthe MasterTable. Setting Up of GridView for the Slave or Item or Child Data Now,adda secondGridView todisplay Slave orItemorChildData. Place thissecondGridViewjust belowthe firstone. Setitspositionto‘Relative’ byusingbelow steps: 1. Drag and Drop secondGridViewintothe webpage. Setsitspositionas‘Relative’byselecting optionsFormat  SetPosition  Relative.Positionitjustbelow the firstGridView. Relative position will helpyoutoplace the secondGridview justbelow the firstGridview. Also,if the firstGridViewgrowswithmore rows(records),itautomaticallypushesthe secondGridviewdown,avoidingoverlappingof twoGridViews.
  • 4. 2. You needtoattach slave / childtable fromback-enddatabase.Inthe Configure Data Source screen,selectsuitable back-endtable. Selectcolumnsyouwanttodisplay.Afterthis,clickon Where Button (See the belowFigure) 3. In the column,choose Key field(ie.The columnwhichiscommonbetweentwotables – Master and Slave);SetOperatorValue to=; SelectSource = Control;Control ID= Gridview1. You can see where clause expressionappearsautomaticallyinthe ‘Where Clause’ window (See the belowFigure). PressOKButton.
  • 5. 4. ClickNext FinishButtons 5. Run thispage ina Browser.Clickon‘SELECT’ Linkinthe FirstGridview togetthe displayof relatedrow(s) inthe SecondGridView. If there are nomatchingrowsavailable inthe Child/Slave table forthe selectedvalue,thentherewillbe nodisplay inthe second GridView.