SlideShare a Scribd company logo
1 of 5
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 conditionDharma 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 viewDharma 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 NetDharma 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 StudioDharma Raju
 
Web services in asp.net
Web services in asp.netWeb services in asp.net
Web services in asp.netDharma Raju
 
Internal tables in sap
Internal tables in sapInternal tables in sap
Internal tables in sapDharma 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

Beyond Inbound: Unlocking the Secrets of API Egress Traffic Management
Beyond Inbound: Unlocking the Secrets of API Egress Traffic ManagementBeyond Inbound: Unlocking the Secrets of API Egress Traffic Management
Beyond Inbound: Unlocking the Secrets of API Egress Traffic Managementseank14
 
Dan Quinn Commanders Feather Dad Hat Hoodie
Dan Quinn Commanders Feather Dad Hat HoodieDan Quinn Commanders Feather Dad Hat Hoodie
Dan Quinn Commanders Feather Dad Hat Hoodierahman018755
 
原版定制英国赫瑞瓦特大学毕业证原件一模一样
原版定制英国赫瑞瓦特大学毕业证原件一模一样原版定制英国赫瑞瓦特大学毕业证原件一模一样
原版定制英国赫瑞瓦特大学毕业证原件一模一样AS
 
Registry Data Accuracy Improvements, presented by Chimi Dorji at SANOG 41 / I...
Registry Data Accuracy Improvements, presented by Chimi Dorji at SANOG 41 / I...Registry Data Accuracy Improvements, presented by Chimi Dorji at SANOG 41 / I...
Registry Data Accuracy Improvements, presented by Chimi Dorji at SANOG 41 / I...APNIC
 
一比一定制波士顿学院毕业证学位证书
一比一定制波士顿学院毕业证学位证书一比一定制波士顿学院毕业证学位证书
一比一定制波士顿学院毕业证学位证书A
 
iThome_CYBERSEC2024_Drive_Into_the_DarkWeb
iThome_CYBERSEC2024_Drive_Into_the_DarkWebiThome_CYBERSEC2024_Drive_Into_the_DarkWeb
iThome_CYBERSEC2024_Drive_Into_the_DarkWebJie Liau
 
一比一原版(Design毕业证书)新加坡科技设计大学毕业证原件一模一样
一比一原版(Design毕业证书)新加坡科技设计大学毕业证原件一模一样一比一原版(Design毕业证书)新加坡科技设计大学毕业证原件一模一样
一比一原版(Design毕业证书)新加坡科技设计大学毕业证原件一模一样AS
 
一比一原版(Soton毕业证书)南安普顿大学毕业证原件一模一样
一比一原版(Soton毕业证书)南安普顿大学毕业证原件一模一样一比一原版(Soton毕业证书)南安普顿大学毕业证原件一模一样
一比一原版(Soton毕业证书)南安普顿大学毕业证原件一模一样Fi
 
TOP 100 Vulnerabilities Step-by-Step Guide Handbook
TOP 100 Vulnerabilities Step-by-Step Guide HandbookTOP 100 Vulnerabilities Step-by-Step Guide Handbook
TOP 100 Vulnerabilities Step-by-Step Guide HandbookVarun Mithran
 
一比一定制加州大学欧文分校毕业证学位证书
一比一定制加州大学欧文分校毕业证学位证书一比一定制加州大学欧文分校毕业证学位证书
一比一定制加州大学欧文分校毕业证学位证书A
 
一比一原版(毕业证书)新西兰怀特克利夫艺术设计学院毕业证原件一模一样
一比一原版(毕业证书)新西兰怀特克利夫艺术设计学院毕业证原件一模一样一比一原版(毕业证书)新西兰怀特克利夫艺术设计学院毕业证原件一模一样
一比一原版(毕业证书)新西兰怀特克利夫艺术设计学院毕业证原件一模一样AS
 
Washington Football Commanders Redskins Feathers Shirt
Washington Football Commanders Redskins Feathers ShirtWashington Football Commanders Redskins Feathers Shirt
Washington Football Commanders Redskins Feathers Shirtrahman018755
 
一比一原版(Wintec毕业证书)新西兰怀卡托理工学院毕业证原件一模一样
一比一原版(Wintec毕业证书)新西兰怀卡托理工学院毕业证原件一模一样一比一原版(Wintec毕业证书)新西兰怀卡托理工学院毕业证原件一模一样
一比一原版(Wintec毕业证书)新西兰怀卡托理工学院毕业证原件一模一样AS
 
一比一原版(TRU毕业证书)温哥华社区学院毕业证如何办理
一比一原版(TRU毕业证书)温哥华社区学院毕业证如何办理一比一原版(TRU毕业证书)温哥华社区学院毕业证如何办理
一比一原版(TRU毕业证书)温哥华社区学院毕业证如何办理Fir
 
Free scottie t shirts Free scottie t shirts
Free scottie t shirts Free scottie t shirtsFree scottie t shirts Free scottie t shirts
Free scottie t shirts Free scottie t shirtsrahman018755
 
APNIC Updates presented by Paul Wilson at CaribNOG 27
APNIC Updates presented by Paul Wilson at  CaribNOG 27APNIC Updates presented by Paul Wilson at  CaribNOG 27
APNIC Updates presented by Paul Wilson at CaribNOG 27APNIC
 
一比一定制(Waikato毕业证书)新西兰怀卡托大学毕业证学位证书
一比一定制(Waikato毕业证书)新西兰怀卡托大学毕业证学位证书一比一定制(Waikato毕业证书)新西兰怀卡托大学毕业证学位证书
一比一定制(Waikato毕业证书)新西兰怀卡托大学毕业证学位证书AS
 
SOC Analyst Guide For Beginners SOC analysts work as members of a managed sec...
SOC Analyst Guide For Beginners SOC analysts work as members of a managed sec...SOC Analyst Guide For Beginners SOC analysts work as members of a managed sec...
SOC Analyst Guide For Beginners SOC analysts work as members of a managed sec...Varun Mithran
 
一比一原版英国创意艺术大学毕业证如何办理
一比一原版英国创意艺术大学毕业证如何办理一比一原版英国创意艺术大学毕业证如何办理
一比一原版英国创意艺术大学毕业证如何办理AS
 
Free on Wednesdays T Shirts Free on Wednesdays Sweatshirts
Free on Wednesdays T Shirts Free on Wednesdays SweatshirtsFree on Wednesdays T Shirts Free on Wednesdays Sweatshirts
Free on Wednesdays T Shirts Free on Wednesdays Sweatshirtsrahman018755
 

Recently uploaded (20)

Beyond Inbound: Unlocking the Secrets of API Egress Traffic Management
Beyond Inbound: Unlocking the Secrets of API Egress Traffic ManagementBeyond Inbound: Unlocking the Secrets of API Egress Traffic Management
Beyond Inbound: Unlocking the Secrets of API Egress Traffic Management
 
Dan Quinn Commanders Feather Dad Hat Hoodie
Dan Quinn Commanders Feather Dad Hat HoodieDan Quinn Commanders Feather Dad Hat Hoodie
Dan Quinn Commanders Feather Dad Hat Hoodie
 
原版定制英国赫瑞瓦特大学毕业证原件一模一样
原版定制英国赫瑞瓦特大学毕业证原件一模一样原版定制英国赫瑞瓦特大学毕业证原件一模一样
原版定制英国赫瑞瓦特大学毕业证原件一模一样
 
Registry Data Accuracy Improvements, presented by Chimi Dorji at SANOG 41 / I...
Registry Data Accuracy Improvements, presented by Chimi Dorji at SANOG 41 / I...Registry Data Accuracy Improvements, presented by Chimi Dorji at SANOG 41 / I...
Registry Data Accuracy Improvements, presented by Chimi Dorji at SANOG 41 / I...
 
一比一定制波士顿学院毕业证学位证书
一比一定制波士顿学院毕业证学位证书一比一定制波士顿学院毕业证学位证书
一比一定制波士顿学院毕业证学位证书
 
iThome_CYBERSEC2024_Drive_Into_the_DarkWeb
iThome_CYBERSEC2024_Drive_Into_the_DarkWebiThome_CYBERSEC2024_Drive_Into_the_DarkWeb
iThome_CYBERSEC2024_Drive_Into_the_DarkWeb
 
一比一原版(Design毕业证书)新加坡科技设计大学毕业证原件一模一样
一比一原版(Design毕业证书)新加坡科技设计大学毕业证原件一模一样一比一原版(Design毕业证书)新加坡科技设计大学毕业证原件一模一样
一比一原版(Design毕业证书)新加坡科技设计大学毕业证原件一模一样
 
一比一原版(Soton毕业证书)南安普顿大学毕业证原件一模一样
一比一原版(Soton毕业证书)南安普顿大学毕业证原件一模一样一比一原版(Soton毕业证书)南安普顿大学毕业证原件一模一样
一比一原版(Soton毕业证书)南安普顿大学毕业证原件一模一样
 
TOP 100 Vulnerabilities Step-by-Step Guide Handbook
TOP 100 Vulnerabilities Step-by-Step Guide HandbookTOP 100 Vulnerabilities Step-by-Step Guide Handbook
TOP 100 Vulnerabilities Step-by-Step Guide Handbook
 
一比一定制加州大学欧文分校毕业证学位证书
一比一定制加州大学欧文分校毕业证学位证书一比一定制加州大学欧文分校毕业证学位证书
一比一定制加州大学欧文分校毕业证学位证书
 
一比一原版(毕业证书)新西兰怀特克利夫艺术设计学院毕业证原件一模一样
一比一原版(毕业证书)新西兰怀特克利夫艺术设计学院毕业证原件一模一样一比一原版(毕业证书)新西兰怀特克利夫艺术设计学院毕业证原件一模一样
一比一原版(毕业证书)新西兰怀特克利夫艺术设计学院毕业证原件一模一样
 
Washington Football Commanders Redskins Feathers Shirt
Washington Football Commanders Redskins Feathers ShirtWashington Football Commanders Redskins Feathers Shirt
Washington Football Commanders Redskins Feathers Shirt
 
一比一原版(Wintec毕业证书)新西兰怀卡托理工学院毕业证原件一模一样
一比一原版(Wintec毕业证书)新西兰怀卡托理工学院毕业证原件一模一样一比一原版(Wintec毕业证书)新西兰怀卡托理工学院毕业证原件一模一样
一比一原版(Wintec毕业证书)新西兰怀卡托理工学院毕业证原件一模一样
 
一比一原版(TRU毕业证书)温哥华社区学院毕业证如何办理
一比一原版(TRU毕业证书)温哥华社区学院毕业证如何办理一比一原版(TRU毕业证书)温哥华社区学院毕业证如何办理
一比一原版(TRU毕业证书)温哥华社区学院毕业证如何办理
 
Free scottie t shirts Free scottie t shirts
Free scottie t shirts Free scottie t shirtsFree scottie t shirts Free scottie t shirts
Free scottie t shirts Free scottie t shirts
 
APNIC Updates presented by Paul Wilson at CaribNOG 27
APNIC Updates presented by Paul Wilson at  CaribNOG 27APNIC Updates presented by Paul Wilson at  CaribNOG 27
APNIC Updates presented by Paul Wilson at CaribNOG 27
 
一比一定制(Waikato毕业证书)新西兰怀卡托大学毕业证学位证书
一比一定制(Waikato毕业证书)新西兰怀卡托大学毕业证学位证书一比一定制(Waikato毕业证书)新西兰怀卡托大学毕业证学位证书
一比一定制(Waikato毕业证书)新西兰怀卡托大学毕业证学位证书
 
SOC Analyst Guide For Beginners SOC analysts work as members of a managed sec...
SOC Analyst Guide For Beginners SOC analysts work as members of a managed sec...SOC Analyst Guide For Beginners SOC analysts work as members of a managed sec...
SOC Analyst Guide For Beginners SOC analysts work as members of a managed sec...
 
一比一原版英国创意艺术大学毕业证如何办理
一比一原版英国创意艺术大学毕业证如何办理一比一原版英国创意艺术大学毕业证如何办理
一比一原版英国创意艺术大学毕业证如何办理
 
Free on Wednesdays T Shirts Free on Wednesdays Sweatshirts
Free on Wednesdays T Shirts Free on Wednesdays SweatshirtsFree on Wednesdays T Shirts Free on Wednesdays Sweatshirts
Free on Wednesdays T Shirts Free on Wednesdays Sweatshirts
 

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.