hjran abdpor
جمعه 07 مرداد 1390, 19:56 عصر
با سلام به دوستان گل.
من یک گرید ویو دارم که اینجوری پرش کردم :
<asp:GridView ID="dg" runat="server" AllowPaging="True" AllowSorting="True" AutoGenerateColumns="False"
CellPadding="4" DataKeyNames="StfCode" ForeColor="#333333" GridLines="None"
Width="688px" DataSourceID="SqlDataSource1">
<FooterStyle BackColor="#5D7B9D" Font-Bold="True" ForeColor="White" />
<Columns>
<asp:ImageField DataImageUrlField="Pic_" HeaderText="عکس" ControlStyle-Width="50px" SortExpression="Pic_">
<HeaderStyle Width="50px"></HeaderStyle>
<ItemStyle Width="130px"/>
</asp:ImageField>
<asp:BoundField DataField="Desc_" HeaderText="توضیحات" SortExpression="fDesc" >
<ItemStyle Width="400px" />
</asp:BoundField>
<asp:BoundField DataField="Price_" HeaderText="قیمت" SortExpression="fPrice">
<ItemStyle Width="100px" />
</asp:BoundField>
<asp:BoundField DataField="StfModel" HeaderText="مدل" SortExpression="StfModel">
<ItemStyle Width="100px" />
</asp:BoundField>
<asp:BoundField DataField="StfCode" HeaderText="کد " SortExpression="StfCode">
<ItemStyle Width="130px" />
</asp:BoundField>
<asp:BoundField DataField="StfName" HeaderText="نام " SortExpression="fName">
<ItemStyle Width="130px" />
</asp:BoundField>
<asp:CommandField ButtonType="Image" SelectImageUrl="~/Image/opened.gif" SelectText="انتخاب"
ShowSelectButton="True">
<ItemStyle Width="50px" />
</asp:CommandField>
</Columns>
<RowStyle BackColor="#F7F6F3" ForeColor="#333333" />
<EditRowStyle BackColor="#999999" />
<SelectedRowStyle BackColor="#E2DED6" Font-Bold="True" ForeColor="#333333" />
<PagerStyle BackColor="#284775" ForeColor="White" HorizontalAlign="Center" />
<HeaderStyle BackColor="#5D7B9D" Font-Bold="True" ForeColor="White" />
<AlternatingRowStyle BackColor="White" ForeColor="#284775" />
</asp:GridView>
که این کار ما باعث نمایش جستجو میشه ، حالا من میخوام که کاربر بعد از جستجو کردن بتواند ویرایش را در همان گرید ویو انجام بدهد ؟؟؟؟؟؟؟؟
چه جوری اینکار را انجام بدم ؟؟؟؟؟؟؟؟؟؟
کد جستجو هم اینه :
dg.EmptyDataText = "جستجو نتیجه ای در بر نداشت ، لطفا جستجو را با گزینه های بیشتری انجام دهید";
try
{
if (TextBox1.Text.Trim().Length > 0)
{
SqlDataSource1.SelectCommand = "select StfCode,StfName,StfModel,Price_,Desc_,Pic_ from StuffInfo where StfCode='" + TextBox1.Text.Trim() + "'";
}
else
{
SqlDataSource1.SelectCommand = "select StfCode,StfName,StfModel,Price_,Desc_,Pic_ from StuffInfo where StfCode='" + TextBox1.Text.Trim() + "'";
}
}
catch (Exception ex)
{
Response.Write(ex.Message);
}
ممنون میشم کمک کنید ؟
من یک گرید ویو دارم که اینجوری پرش کردم :
<asp:GridView ID="dg" runat="server" AllowPaging="True" AllowSorting="True" AutoGenerateColumns="False"
CellPadding="4" DataKeyNames="StfCode" ForeColor="#333333" GridLines="None"
Width="688px" DataSourceID="SqlDataSource1">
<FooterStyle BackColor="#5D7B9D" Font-Bold="True" ForeColor="White" />
<Columns>
<asp:ImageField DataImageUrlField="Pic_" HeaderText="عکس" ControlStyle-Width="50px" SortExpression="Pic_">
<HeaderStyle Width="50px"></HeaderStyle>
<ItemStyle Width="130px"/>
</asp:ImageField>
<asp:BoundField DataField="Desc_" HeaderText="توضیحات" SortExpression="fDesc" >
<ItemStyle Width="400px" />
</asp:BoundField>
<asp:BoundField DataField="Price_" HeaderText="قیمت" SortExpression="fPrice">
<ItemStyle Width="100px" />
</asp:BoundField>
<asp:BoundField DataField="StfModel" HeaderText="مدل" SortExpression="StfModel">
<ItemStyle Width="100px" />
</asp:BoundField>
<asp:BoundField DataField="StfCode" HeaderText="کد " SortExpression="StfCode">
<ItemStyle Width="130px" />
</asp:BoundField>
<asp:BoundField DataField="StfName" HeaderText="نام " SortExpression="fName">
<ItemStyle Width="130px" />
</asp:BoundField>
<asp:CommandField ButtonType="Image" SelectImageUrl="~/Image/opened.gif" SelectText="انتخاب"
ShowSelectButton="True">
<ItemStyle Width="50px" />
</asp:CommandField>
</Columns>
<RowStyle BackColor="#F7F6F3" ForeColor="#333333" />
<EditRowStyle BackColor="#999999" />
<SelectedRowStyle BackColor="#E2DED6" Font-Bold="True" ForeColor="#333333" />
<PagerStyle BackColor="#284775" ForeColor="White" HorizontalAlign="Center" />
<HeaderStyle BackColor="#5D7B9D" Font-Bold="True" ForeColor="White" />
<AlternatingRowStyle BackColor="White" ForeColor="#284775" />
</asp:GridView>
که این کار ما باعث نمایش جستجو میشه ، حالا من میخوام که کاربر بعد از جستجو کردن بتواند ویرایش را در همان گرید ویو انجام بدهد ؟؟؟؟؟؟؟؟
چه جوری اینکار را انجام بدم ؟؟؟؟؟؟؟؟؟؟
کد جستجو هم اینه :
dg.EmptyDataText = "جستجو نتیجه ای در بر نداشت ، لطفا جستجو را با گزینه های بیشتری انجام دهید";
try
{
if (TextBox1.Text.Trim().Length > 0)
{
SqlDataSource1.SelectCommand = "select StfCode,StfName,StfModel,Price_,Desc_,Pic_ from StuffInfo where StfCode='" + TextBox1.Text.Trim() + "'";
}
else
{
SqlDataSource1.SelectCommand = "select StfCode,StfName,StfModel,Price_,Desc_,Pic_ from StuffInfo where StfCode='" + TextBox1.Text.Trim() + "'";
}
}
catch (Exception ex)
{
Response.Write(ex.Message);
}
ممنون میشم کمک کنید ؟