G
Guest
I cant bind my datagrid into my web form, and it also doesnt give any
error...please help me..
private void Page_Load(object sender, System.EventArgs e)
{
if (Page.IsPostBack)
return;
if (Request.QueryString["centerId"]!=null)
bindMySurvey(Int32.Parse(Request.QueryString["centerId"].ToString()));
}
--------------
<asp:datagrid id="myDataGrid" runat="server" Font-Size="Smaller"
Font-Names="Verdana" Width="992px"
AllowSorting="True" CellPadding="1" CellSpacing="1"
AutoGenerateColumns="False" BorderColor="Gray">
<SelectedItemStyle CssClass="selectedGridRow"></SelectedItemStyle>
<EditItemStyle CssClass="defaultGridEditItem"></EditItemStyle>
<AlternatingItemStyle
CssClass="defaultGridAlternatingRow"></AlternatingItemStyle>
<ItemStyle CssClass="defaultGridRow"></ItemStyle>
<HeaderStyle CssClass="defaultGridHeader"></HeaderStyle>
<Columns>
<asp:TemplateColumn HeaderText="Sorular">
<HeaderStyle HorizontalAlign="Center" Width="400px"></HeaderStyle>
<ItemStyle HorizontalAlign="Left" Width="400px"></ItemStyle>
<ItemTemplate>
<%# DataBinder.Eval(Container.DataItem,"QUESTION_DESC")%>
<asp:TextBox id="textQuestionId" runat="server" Visible="False"
Text='<%# DataBinder.Eval(Container.DataItem,"QUESTION_ID")%>'>
</asp:TextBox>
</ItemTemplate>
</asp:TemplateColumn>
<asp:TemplateColumn HeaderText="Evet">
<HeaderStyle HorizontalAlign="Center"></HeaderStyle>
<ItemStyle HorizontalAlign="Center"></ItemStyle>
<ItemTemplate>
<asp:CheckBox id="cbYes" Checked="True"
runat="server"></asp:CheckBox>
</ItemTemplate>
</asp:TemplateColumn>
<asp:TemplateColumn HeaderText="Hayır">
<HeaderStyle HorizontalAlign="Center"></HeaderStyle>
<ItemStyle HorizontalAlign="Center"></ItemStyle>
<ItemTemplate>
<asp:CheckBox id="cbNo" runat="server"></asp:CheckBox>
</ItemTemplate>
</asp:TemplateColumn>
<asp:TemplateColumn HeaderText="Yorumlar">
<HeaderStyle HorizontalAlign="Center" Width="50px"></HeaderStyle>
<ItemStyle HorizontalAlign="Center" Width="50px"></ItemStyle>
<ItemTemplate>
<asp:Textbox id="textComment" runat="server"
CssClass="defaultTextItemLeft" Width="400" MaxLength="1024"
TextMode="MultiLine" Rows="1"></asp:Textbox>
</ItemTemplate>
</asp:TemplateColumn>
</Columns>
</asp:datagrid>
private void bindMySurvey(int centerId)
{
coreMarseg.clinicalTrials mySurvey = new coreMarseg.clinicalTrials();
coreMarseg.Units myUnit = new coreMarseg.Units();
DataSet myDataSet = mySurvey.getSurvey(centerId);
comboCenterName.DataSource =
myUnit.getUnitName(Int32.Parse(Request.QueryString["centerId"].ToString()));
comboCenterName.DataTextField = "CENTER_NAME";
comboCenterName.DataValueField = "CENTER_ID";
comboCenterName.DataBind();
textRowId.Text = myDataSet.Tables[0].Rows[0]["ROWID"].ToString();
comboCenterName.SelectedIndex =
comboCenterName.Items.IndexOf(comboCenterName.Items.FindByValue(myDataSet.Tables[0].Rows[0]["CENTER_ID"].ToString()));
textCenterResponsible.Text =
myDataSet.Tables[0].Rows[0]["CENTER_RESPONSIBLE"].ToString();
textCenterResponsibleTitle.Text =
myDataSet.Tables[0].Rows[0]["CENTER_RESPONSIBLE_TITLE"].ToString();
textCenterResResponsibility.Text =
myDataSet.Tables[0].Rows[0]["CENTER_RES_RESPONSIBILITY"].ToString();
bindMyDataGrid(Int32.Parse(Request.QueryString["centerId"].ToString()),
Int32.Parse(Request.QueryString["questionId"].ToString()));
}
private void bindMyDataGrid(int centerId, int questionId)
{
coreMarseg.clinicalTrials mySurvey = new coreMarseg.clinicalTrials();
myDataGrid.DataSource = mySurvey.getSurveyDetail(centerId, questionId);
myDataGrid.DataBind();
}
error...please help me..
private void Page_Load(object sender, System.EventArgs e)
{
if (Page.IsPostBack)
return;
if (Request.QueryString["centerId"]!=null)
bindMySurvey(Int32.Parse(Request.QueryString["centerId"].ToString()));
}
--------------
<asp:datagrid id="myDataGrid" runat="server" Font-Size="Smaller"
Font-Names="Verdana" Width="992px"
AllowSorting="True" CellPadding="1" CellSpacing="1"
AutoGenerateColumns="False" BorderColor="Gray">
<SelectedItemStyle CssClass="selectedGridRow"></SelectedItemStyle>
<EditItemStyle CssClass="defaultGridEditItem"></EditItemStyle>
<AlternatingItemStyle
CssClass="defaultGridAlternatingRow"></AlternatingItemStyle>
<ItemStyle CssClass="defaultGridRow"></ItemStyle>
<HeaderStyle CssClass="defaultGridHeader"></HeaderStyle>
<Columns>
<asp:TemplateColumn HeaderText="Sorular">
<HeaderStyle HorizontalAlign="Center" Width="400px"></HeaderStyle>
<ItemStyle HorizontalAlign="Left" Width="400px"></ItemStyle>
<ItemTemplate>
<%# DataBinder.Eval(Container.DataItem,"QUESTION_DESC")%>
<asp:TextBox id="textQuestionId" runat="server" Visible="False"
Text='<%# DataBinder.Eval(Container.DataItem,"QUESTION_ID")%>'>
</asp:TextBox>
</ItemTemplate>
</asp:TemplateColumn>
<asp:TemplateColumn HeaderText="Evet">
<HeaderStyle HorizontalAlign="Center"></HeaderStyle>
<ItemStyle HorizontalAlign="Center"></ItemStyle>
<ItemTemplate>
<asp:CheckBox id="cbYes" Checked="True"
runat="server"></asp:CheckBox>
</ItemTemplate>
</asp:TemplateColumn>
<asp:TemplateColumn HeaderText="Hayır">
<HeaderStyle HorizontalAlign="Center"></HeaderStyle>
<ItemStyle HorizontalAlign="Center"></ItemStyle>
<ItemTemplate>
<asp:CheckBox id="cbNo" runat="server"></asp:CheckBox>
</ItemTemplate>
</asp:TemplateColumn>
<asp:TemplateColumn HeaderText="Yorumlar">
<HeaderStyle HorizontalAlign="Center" Width="50px"></HeaderStyle>
<ItemStyle HorizontalAlign="Center" Width="50px"></ItemStyle>
<ItemTemplate>
<asp:Textbox id="textComment" runat="server"
CssClass="defaultTextItemLeft" Width="400" MaxLength="1024"
TextMode="MultiLine" Rows="1"></asp:Textbox>
</ItemTemplate>
</asp:TemplateColumn>
</Columns>
</asp:datagrid>
private void bindMySurvey(int centerId)
{
coreMarseg.clinicalTrials mySurvey = new coreMarseg.clinicalTrials();
coreMarseg.Units myUnit = new coreMarseg.Units();
DataSet myDataSet = mySurvey.getSurvey(centerId);
comboCenterName.DataSource =
myUnit.getUnitName(Int32.Parse(Request.QueryString["centerId"].ToString()));
comboCenterName.DataTextField = "CENTER_NAME";
comboCenterName.DataValueField = "CENTER_ID";
comboCenterName.DataBind();
textRowId.Text = myDataSet.Tables[0].Rows[0]["ROWID"].ToString();
comboCenterName.SelectedIndex =
comboCenterName.Items.IndexOf(comboCenterName.Items.FindByValue(myDataSet.Tables[0].Rows[0]["CENTER_ID"].ToString()));
textCenterResponsible.Text =
myDataSet.Tables[0].Rows[0]["CENTER_RESPONSIBLE"].ToString();
textCenterResponsibleTitle.Text =
myDataSet.Tables[0].Rows[0]["CENTER_RESPONSIBLE_TITLE"].ToString();
textCenterResResponsibility.Text =
myDataSet.Tables[0].Rows[0]["CENTER_RES_RESPONSIBILITY"].ToString();
bindMyDataGrid(Int32.Parse(Request.QueryString["centerId"].ToString()),
Int32.Parse(Request.QueryString["questionId"].ToString()));
}
private void bindMyDataGrid(int centerId, int questionId)
{
coreMarseg.clinicalTrials mySurvey = new coreMarseg.clinicalTrials();
myDataGrid.DataSource = mySurvey.getSurveyDetail(centerId, questionId);
myDataGrid.DataBind();
}